ssh-host-config, 不要privilege user
ssh-keygen, 不設密碼
其他採用默認設置
最後
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
從/usr/sbin/sshd啓動sshd,不要從windows的service上啓動,否則會要輸入windows用戶的密碼
或者,
把/etc/ssh/sshd_config中的PasswordAuthentication 設爲 no,並複製id_rsa.pub爲authorized_keys
最後,重啓ssh服務:
service ssh restart
refer: