1.首先生成密钥,用命令ssh-keygen –t rsa 产生的秘钥位于当前用户 ~/.ssh文件夹中 一个劲的回车键桥 2. cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys 验证: ssh localhost