What are you trying to protect against? Users with permitted access doing stuff they shouldn’t or from anyone else accessing the device?

If it’s the first one you should give each user an account without sudo privileges and never share accounts/passwords.

If it’s the latter you should create a public/private encrypted key and disable log-in by username, that will give a much higher level of security as general user/password brute force simply won’t work.

I have many RPi’s inside schools all across the country and whilst I do take other measures, using a key with user account log-in disabled makes all the difference, but what made even more difference to the number of attacks was to simply change the SSH port to something unrelated to SSH eg 50123.

2 Likes