Answers for "linux disable ssh user login"

2

disable ssh login for user

# To deny SSH access to specific user called “sk”, edit sshd_config file:
$ sudo vi /etc/ssh/sshd_config

# Add/edit the following line in sshd_config file.
DenyUsers sk

# Deny SSH access to multiple users, specify the usernames with space separated as shown below.
DenyUsers sk ostechnix

# Deny SSH access to an entire group, for example root, add:
DenyGroups root

# Save and quit the ssh config file. Restart ssh service to take effect the changes.
$ sudo systemctl restart sshd
Posted by: Guest on March-28-2020

Code answers related to "linux disable ssh user login"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language