Restricting sshd by username

Step # 1: Open sshd_config file

# vi /etc/ssh/sshd_config

Step # 2: Specify a user

Only allow user king to login by adding following line:
AllowUsers king

Step # 3: Restart sshd

Save and close the file. In the above example, user vivek has already been created on the system. Now just restart sshd:
# service sshd restart

About vicki

Welcome to the Sovereign Republic of Vickistan. I am the President here. Lucky me! No taxes or laws yet. Lucky you!
This entry was posted in Linux. Bookmark the permalink.