SSH is one of the most common techniques to access Raspberry Pi over the network and it becomes necessary to use if you want to make it secure.
Improving SSH security
Username and password security
Apart from having a strong password, we can allow and deny access to specific users. This can be done by making changes in the sshd_config file. Run the sudo nano /etc/ssh/sshd_config command.
This will open up the sshd_config file; then, add the following line(s) at the end to allow or deny specific users:
- To allow users, add the line: AllowUsers tom john merry
- To deny users, add this line: DenyUsers peter methew
For these changes to take effect, it is necessary to reboot the Raspberry Pi.