Advertisement
Telegram ads for your business · TCA Media
Advertisement
Telegram ads for your business · TCA Media
IT

SSH with a password — no! But if you really want to, you can

Password-based SSH login is less secure than key-based authentication but may be suitable for one-time connections from third-party devices—with restrictions and MFA.

02 Dec, 16:23Read in Russian
enterno.io

When connecting via SSH, a shared symmetric key is first established to encrypt the traffic. Therefore, the password and other authentication data are transmitted within an already secured channel.

Key-based authentication protects the host: the server verifies the signature generated with the private key, while the public key is stored on the server. The main issue is the need to securely store the private key on each device. A password verifies the user, but it can be guessed, stolen via a keylogger, or obtained through phishing.

Password-based login may be more practical if you need to connect once from an arbitrary computer. No key will remain on a temporary device, and a compromised password can be quickly replaced. However, the author recommends disabling root login, allowing SSH access only for listed users, and limiting the number of attempts to 3. The password should include letters in both cases, digits, and special characters, and be at least 8 characters long.

Additional security is provided by MFA via PAM and TOTP. After entering the password, the user inputs a one-time code from an authenticator app. A new code is generated every 30 seconds, and the server's precise time is required for verification. In the SSH configuration, password authentication can be enabled not for all users but only for a specific account.

Advertisement
Telegram ads for your business · TCA Media