Click here for "Error Codes for Commercial Air Conditioners".

AlmaLinux 8.6 : SSH , Firewall , NTP

1. Setting up SSH remote connection

SSH is a service for connecting remotely to a server and is basically running immediately after the OS is installed, but the default settings are somewhat insecure.
Here we will configure the default settings to increase the security of ssh connections.

1.1 SSH service configuration file changes

Modify the configuration file to change the SSH service settings.
The SSH service configuration file is "/etc/ssh/sshd_config".

Line 17 "Port 22" This time change to "Port 2244" and proceed
Delete the "#" in line 20 "#ListenAddress 0.0.0.0
Change "PermitRootLogin yes" to "PermitRootLogin no" on line 44.
Since the root user already knows the user name and can log in to the server with administrator privileges once the password is known, the setting is set to deny this.

SSH Restart

If this is not done, the next time you reboot, you will not be able to connect remotely via SSH. Please free SSH port 2244 in the following firewall settings.

2. How to set up a firewall (firewalld)

In AlmaLinux, the firewall is set to firewalld by default and is enabled during OS installation.

Briefly explaining "firewalld," when setting communication control policies, the method is to apply communication permission/blocking rules to predefined zones, and then assign those zones to each NIC (network adapter).

2.1 How to use the "firewall-cmd" command to control "firewalld

1)Command to check the status and settings of "firewalld"

① Check firewalld operation status

OR

➁ View default zone settings
In the above example, we can see that the services "cockpit", "dhcpv6-client", "ssh" are allowed, etc.

③ About the "--permanent" option
To prevent the settings from disappearing when the server is restarted or the "firewalld" service is restarted, you must use the "--permanent" option.
The "--permanent" option must be used to configure the settings.
If the "--permanent" option is specified, the setting is not reflected in "firewalld" as it is, so it is necessary to reflect the setting by "fiewall-cmd --reload".

As an example, to use the HTTP service permanently without initialization even if the system is rebooted

④ How to start/stop

Since "firewalld" is controlled by "systemd", use the "systemctl" command to start and stop it.

2.2 Release modified SSH port 2244

2244/tcp ports have been added

3. Remote connection from Windows

Configuration in Windows

The terminal emulator is "Tera Term".
Start Tera Term, cancel the startup screen, and then select "New Connection" from "File" in the Tera Term menu.

Enter the server IP address in "Host" and the SSH port number in "TCP port#". Finally, click "OK.

After clicking "OK," click "Continue" on the security confirmation screen.

Enter a general user name in "User name" and a general user password in "Passphrasee", then click "OK".

If the information is correct, you should be able to log in normally as shown below.

4. NTP Server Settings

Synchronize server time with Japan Standard Time

Chrony Installation and Configuration

② Restart chrony and enable chrony after system reboot

③ NTP port release in firewall

④ Check chronyd status (behavior)

If it is marked with "^*", it has been synchronized.

Copied title and URL