写入公钥

mkdir ~/.ssh/ && vi ~/.ssh/authorized_keys

chown -R 0700 ~/.ssh && chown -R 0644 ~/.ssh/authorized_keys

配置ssh(密钥)登录

vi /etc/ssh/sshd_config

开启ssh(密钥)登录

StrictModes no

RSAAuthentication yes

PubkeyAuthentication yes

AuthorizedKeysFile .ssh/authorized_keys

关闭密码登录

PasswordAuthentication no