Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

disable ssh login only keys

$ sudo vi /etc/ssh/sshd_config

#Disable password for users so they can only connect with keys
# At the end of the file
ChallengeResponseAuthentication no

Match User user1,user2,root
    PasswordAuthentication no

Match Group data_user
	PasswordAuthentication no

# To check syntax error in the file
$ sshd -t 
# Restart the server
$ sudo systemctl restart ssh
 
PREVIOUS NEXT
Tagged: #disable #ssh #login #keys
ADD COMMENT
Topic
Name
5+4 =