Follow these commands and you are ready:
sudo apt-get update
sudo apt-get install openssh-server
sudo ufw allow 22
That's the very minimum. It allows unlimited failed password attempts on a known port. Direct root-login is disabled (you can still su and sudo once logged in).
You need to harden it from the standard setup. I suggest:
- Key-based logins. Disable password logins.
- Move it off port 22. Use something crazy-high, in the 20000-60000 range.
- Use
fail2ban
to ban people who do find it and try to brute it.
Open /etc/ssh/sshd_config as root user and change PORT
sudo ufw allow PORT
sudo /etc/init.d/ssh restart
use raspberry user to remotely loginIf SSH service not start automatically on boot, try just simply setting
sudo systemctl enable ssh
0 comments:
Post a Comment