Linux SSH Service Configuration: Remote Connection and Security Settings
SSH is a secure protocol for remotely managing Linux servers, replacing the plaintext-transmitted Telnet. Installation requires installing openssh-server on the server using apt (for Ubuntu/Debian) or yum/dnf (for CentOS), followed by starting the service and enabling it to launch on boot. For connection, Windows users can use PuTTY or the system's built-in client, while Linux/macOS users can directly execute the ssh command in the terminal. The core configuration is in sshd_config, where it is recommended to change the port (e.g., to 2222), disable direct root login, and switch from password authentication to key-based login (by generating a key pair locally and copying the public key to the server). The corresponding port must be opened in the firewall. Key-based login enhances security, and changes take effect after restarting the service. Common issues can be checked via logs, and permission errors may require setting ~/.ssh permissions to 700 and authorized_keys to 600. These key security settings ensure secure remote management.
Read MoreEssential for Beginners: 5 Basic Linux Server Commands
This article introduces 5 basic core commands for Linux servers to help beginners quickly get started. The `ls` command is used to view directory files, displaying the current directory by default. Common parameters include `ls -l` (detailed information), `ls -a` (including hidden files), and `ls [path]` (specifying a directory). The `cd` command switches directories: `cd [directory name]` enters a subdirectory, `cd ..` returns to the parent directory, `cd ~` goes to the home directory, and `cd /` navigates to the root directory. The `pwd` command directly displays the current path, preventing operational errors. `mkdir` creates directories: `mkdir [directory name]` creates a single-level directory, while `mkdir -p [multi-level]` builds nested directories. `df -h` checks disk space, with `-h` converting to human-readable units to view partition sizes and usage rates. These 5 "foundation" commands are fundamental for server management. Practicing parameters (e.g., `ls -l/a`, `mkdir -p`) and familiarizing with the "parameter + target" mode will help beginners gradually advance their skills.
Read More