我生成了id_rsa.pub并将其添加到authorized_keys . 但当我做 ssh localhost 时,连接立即关闭 Connection closed by ::1

输出

ssh -v localhost

mymachine:~xxxxxx $ ssh -v localhost OpenSSH_6.9p1,LibreSSL 2.1.8 debug1:读取配置数据/ etc / ssh / ssh_config debug1:/ etc / ssh / ssh_config第21行:应用* debug1的选项:连接到localhost [ :: 1]端口22. debug1:已 Build 连接 . debug1:identity file /Users/xxxxxx/.ssh/id_rsa type 1 debug1:key_load_public:没有这样的文件或目录debug1:identity file /Users/xxxxxx/.ssh/id_rsa-cert type -1 debug1:key_load_public:没有这样的文件或目录debug1:身份文件/Users/xxxxxx/.ssh/id_dsa类型-1 debug1:key_load_public:没有这样的文件或目录debug1:身份文件/Users/xxxxxx/.ssh/id_dsa-cert类型-1 debug1:key_load_public:没有这样的文件或目录debug1:identity file /Users/xxxxxx/.ssh/id_ecdsa type -1 debug1:key_load_public:没有这样的文件或目录debug1:identity file /Users/xxxxxx/.ssh/id_ecdsa-cert type -1 debug1:key_load_public:没有这样的文件或目录debug1:identity file /Users/xxxxxx/.ssh/id_ed25519 type -1 debug1:key_load_public:没有这样的文件或目录debug1:identity file /Users/xxxxxx/.ssh/id_ed25519-cert type -1 debug1:为协议2.0调试1启用兼容模式:本地版本字符串SSH-2.0-OpenSSH_6.9 debug1:远程协议版本2.0,远程软件版本O penSSH_6.9 debug1:匹配:OpenSSH_6.9 pat打开OpenSSH * compat 0x04000000 debug1:认证到localhost:22作为'xxxxxx'debugup1:SSH2_MSG_KEXINIT发送debug1:SSH2_MSG_KEXINIT收到debug1:kex:server-> client chacha20-poly1305@openssh.com none debug1:kex:client-> server chacha20-poly1305@openssh.com none debug1:expecting SSH2_MSG_KEX_ECDH_REPLY debug1:服务器主机密钥:ecdsa-sha2-nistp256 SHA256:BfO1TyMSGKv0C1OG0osGN7AEXfmYV43 / xxxxxxxxxx debug1:主机'localhost'已知并与ECDSA主机密钥匹配 . debug1:找到密钥在/Users/xxxxxx/.ssh/known_hosts:5 debug1:SSH2_MSG_NEWKEYS发送debug1:期待SSH2_MSG_NEWKEYS debug1:SSH2_MSG_NEWKEYS收到debug1:SSH2_MSG_SERVICE_REQUEST发送debug1:SSH2_MSG_SERVICE_ACCEPT收到debug1:认证可以继续:publickey,keyboard-interactive debug1:下一个身份验证方法:publickey debug1:提供RSA公钥:/Users/xxxxxx/.ssh/id_rsa debug1:服务器接受密钥:pkalg ssh-rsa blen 279连接关闭:: 1