sed -i "s/^PasswordAuthentication.*/PasswordAuthentication no/g" /etc/ssh/sshd_config
sed -i "s/^#RSAAuthentication.*/RSAAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/^#PubkeyAuthentication.*/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
sed -i "s/^#AuthorizedKeysFile.*/AuthorizedKeysFile .ssh\/authorized_keys/g" /etc/ssh/sshd_config
Created
November 24, 2020 09:37
-
-
Save Linuxpizi/039e2f729632edbf87d3f6a0f29f122b to your computer and use it in GitHub Desktop.
ssh 禁止密码登录
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment