Answers for "how to disable password for ssh sudo users only"

2

disable ssh password login

$ sudo vi /etc/ssh/sshd_config


ChallengeResponseAuthentication no
PasswordAuthentication no
Posted by: Guest on May-11-2021
1

how to disable password for ssh sudo users only

$ 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
Posted by: Guest on May-03-2022

Code answers related to "how to disable password for ssh sudo users only"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language