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

OpenSUSE16.0 : Firewall , SSH、NTP Server

1.Configuring Remote Connections via SSH

SSH is a service for remotely connecting to servers, and it typically runs immediately after OS installation. However, the default configuration has some security vulnerabilities.
Here, we will modify the default settings to enhance the security of SSH connections.

1.1 Modifying the SSH Service Configuration File

Modify the configuration file to change the SSH service settings.
The path for the SSH service configuration file has been changed from the previous "/etc/ssh/sshd_config" to "/usr/etc/ssh/sshd_config".

Restarting SSH

If you leave it as is, you won't be able to connect remotely via SSH after the next reboot. Please open SSH port 2244 in the following firewall settings.

2.How to configure the firewall (firewalld)

On openSUSE, firewalld is set as the default firewall and is enabled during OS installation.

To briefly explain "firewalld," when configuring communication control policies, it applies rules to allow or block traffic for predefined zones, then assigns those zones to each NIC (network interface card).

2.1 How to Use the "firewall-cmd" Command to Control "firewalld"

①firewalld operational status check

If "firewalld" is running, it will display "running"; if it is stopped, it will display "not running".

OR

※When stopped
Active: inactive (dead) is displayed, indicating that firewalld is stopped.

➁About the "--permanent" Option
To prevent settings from being lost when restarting the server or the "firewalld" service,
you must configure settings using the "--permanent" option. When configuring with the "--permanent" option, the settings will not be reflected in "firewalld" immediately; you must use "firewall-cmd --reload" to apply the changes.

For example, to ensure an HTTP service remains available permanently without being reset upon system restart,

➂Startup and Shutdown Procedures

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

2.2  Release the modified SSH port 2244

3.Remote connection from Windows

Windows Settings

Begin configuring remote connections from Windows. Use the terminal emulator "Tera Term".
Launch Tera Term, cancel the startup screen, then select "New Connection" from the "File" menu in Tera Term.

The next screen will appear, so enter the following:
Host: The server's IP address
TCP port: The SSH port number you changed above

Click "OK" to proceed to the security confirmation screen. Check the box next to "Replace the exit key with this new key" and click "Continue".

The next screen will appear
User name: General login username
Passphrase: Password for the above user

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

4. NTP Server Configuration

Install Chrony to set up an NTP server for time synchronization. Note that NTP uses port 123/UDP.

① Chrony Installation

➁ Chrony Configuration

➂ Opening the NTP port

If Firewalld is enabled, you must allow the NTP service. Note that NTP uses port 123/UDP.

④ Functionality Verification

Copied title and URL