/etc/ssh/sshd_config
RSAAuthentication yes # 启用 RSA 认证,默认为yes
PubkeyAuthentication yes # 启用公钥认证,默认为yes
generate client public and private key
ssh-keygen -t rsa
Step 3
cat id_rsa.pub >> .ssh/authorized_keys
prevent user from login by password
/etc/sshd/sshd_config
PasswordAuthentication no
modify mode
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
原文地址:https://www.cnblogs.com/otfsenter/p/9684094.html
时间: 2024-11-10 13:20:00