SSH

SSH, or Secure Shell, enables users to connect to a remote server securely.

Here are a few things you need to tweak in order to improve SSH server security.

IMPORTANT: Before making any modifications to the /etc/sshd_config file, make a backup by:

sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults

…and

sudo chmod a-w /etc/ssh/sshd_config.factory-defaults

NOTE: Not all of the possible changes mentioned below have to be made.

Some changes are not recommended to be made but may offer tighter security depending on your requirements.


Agent forwarding

Blacklist a public key

Change the Port

Check the Current SSH Ports

Configure sshd

Configure sshd with multiple authentication factors

Configuring sshd

Creating public/private key authentication for SSH

Disable SSH root login

Disabling sshd

Distribute public keys

ERROR - SSH Connection Refused

Get the host's fingerprint

Install SSH

Limit user logins

Manage SSH Key File With Passphrase

Override socket-activated SSH

Port Forwarding

Restart SSH

Setup SSH Keys

SSH Login Message

Test mode

Troubleshooting SSH

Two-Factor Authentication (using Google Authenticator)

Use SSH without a password