ssh public key to login server

/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
posted @ 2018-09-20 23:51  idlewith  阅读(159)  评论(0编辑  收藏  举报