# ssh-keygen
# ls -a .ssh/
# ssh-copy-id -i .ssh/id_rsa.pub 192.168.1.150
# vi /etc/ssh/sshd_config
PasswordAuthentication no //禁止使用基于口令认证的方式登陆
PubkeyAuthentication yes //允许使用基于密钥认证的方式登陆
# /etc/init.d/sshd restart
若.ssh目录不存在,请创建它,并把公钥信息写入文件中:
# mkdir ~/.ssh
# chmod 700 ~/.ssh
# vi ~/.ssh/authorized_keys
# chmod 644 ~/.ssh/authorized_keys