業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

AlmaLinux10.1 : SSH、Firewalld、NTP Server

1.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

To change the SSH service settings, modify the configuration file.
The SSH service configuration file is located at "/etc/ssh/sshd_config".

Line 21 "Port 22" This time change to "Port 2244" and proceed
Delete "#" from line 23 "#ListenAddress 0.0.0.0".
Line 40, "#PermitRootLogin prohibit-password", delete "#".
The root user can log in to the server with administrator privileges if the user name is already known and the password is known, so the settings are set to deny this.

Restart SSH

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.

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

1)How to use the "firewall-cmd" command to control "firewalld"

①Check firewalld operation status
If "firewalld" is running, the message "running" will be displayed; if it is not running, the message "not running" will be displayed

or
Active: active (running) is displayed

About the "--permanent" option
To prevent the settings from disappearing when the server is restarted or the "firewalld" service is restarted, the
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 use "fiewall-cmd --reload" to reflect the setting.

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  Allow modified SSH port 2244

2244 ports have been added

3.Remote connection from Windows

How to connect using Tabby Terminal
Specify the SSH port number changed with the" -p 2244" option.

C:\Users\xxxxx>ssh huong@192.168.11.83 -p 2244

huong@192.168.11.83's password:
Web console: https://localhost:9090/ or https://192.168.11.83:9090/

Last login: Tue Nov 25 14:58:04 2025 from 192.168.11.6
huong@Lepard:~$

4.NTP Server

Build an NTP server to synchronize the server time with Japan Standard Time

Chrony Installation and Configuration

Restart chrony and enable chrony after system reboot

NTP port allowed in firewall

Check chronyd status (behavior)

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

Copied title and URL