我使用的ssh客户端是SSH Secure Shell。产生公钥,并上传到服务器的用户目录下的.ssh2目录。 然后服务器执行: ssh-keygen -i -f my_dsa_key.pub > authorized_keys 然后: vim /etc/ssh/sshd_config 将 #AuthorizedKeysFile %h/.ssh/authorized_keys 的注释取消,改成 AuthorizedKeysFile %h/.ssh2/authorized_keys 重启sshd即可。 /etc/init.d/sshd restart