Appearance
Secure SSH Access
Using SSH keys instead of passwords protects your server from brute-force attacks.
Configuration
- Generate SSH Key Pair (on your local machine)
sh
ssh-keygen -t ed25519 -C "your_email@example.com"Press Enter to save it in the default location. You can add a passphrase for extra security.
- Copy the Public Key to the Server (on your local machine)
sh
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@your-server-ip- Open the SSH configuration (on your server)
sh
sudo nano /etc/ssh/sshd_configSet these parameters to "no":
yaml
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM noSave with CTRL + X / Y / Enter
- Check the configuration for syntax errors
sh
sudo sshd -t- Restart the SSH service
sh
sudo systemctl restart ssh