Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ssh无密码登录到本地主机_Ssh_Osx Mountain Lion - Fatal编程技术网

ssh无密码登录到本地主机

ssh无密码登录到本地主机,ssh,osx-mountain-lion,Ssh,Osx Mountain Lion,我正在尝试为分布式计算教程设置无密码登录到本地主机。(我已经为多个远程主机成功设置了它。)我完成了生成rsa密钥并将公钥附加到授权密钥的正常步骤,但仍会提示我输入密码。我还在/etc/ssh\u config中启用了RSAAuthentication和publikeyauthentication。按照我看到的其他建议,我尝试了: chmod go-w ~/ chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys 但问题依然存在 以下是ssh-v lo

我正在尝试为分布式计算教程设置无密码登录到本地主机。(我已经为多个远程主机成功设置了它。)我完成了生成rsa密钥并将公钥附加到
授权密钥
的正常步骤,但仍会提示我输入密码。我还在
/etc/ssh\u config
中启用了
RSAAuthentication
publikeyauthentication
。按照我看到的其他建议,我尝试了:

chmod go-w ~/
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
但问题依然存在

以下是ssh-v localhost的输出:

(tutorial)bnels21-2:tutorial bnels21$ ssh -v localhost
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to localhost [::1] port 22.
debug1: Connection established.
debug1: identity file /Users/bnels21/.ssh/id_rsa type 1
debug1: identity file /Users/bnels21/.ssh/id_rsa-cert type -1
debug1: identity file /Users/bnels21/.ssh/id_dsa type -1
debug1: identity file /Users/bnels21/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9
debug1: match: OpenSSH_5.9 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: RSA 1c:31:0e:56:93:45:dc:f0:77:6c:bd:90:27:3b:c6:43
debug1: Host 'localhost' is known and matches the RSA host key.
debug1: Found key in /Users/bnels21/.ssh/known_hosts:11
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/bnels21/.ssh/id_rsa
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Offering RSA public key: id_rsa3
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /Users/bnels21/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:
(教程)bnels21-2:教程bnels21$ssh-v localhost
OpenSSH_5.9p1,OpenSSL 0.9.8r 2011年2月8日
debug1:读取配置数据/etc/ssh\u config
debug1:/etc/ssh\u配置第20行:应用*
debug1:连接到本地主机[::1]端口22。
debug1:已建立连接。
debug1:identity file/Users/bnels21/.ssh/id\u rsa类型1
debug1:identity file/Users/bnels21/.ssh/id_rsa-cert type-1
debug1:identity file/Users/bnels21/.ssh/id_dsa type-1
debug1:identity file/Users/bnels21/.ssh/id_dsa-cert type-1
debug1:远程协议版本2.0,远程软件版本OpenSSH_5.9
debug1:match:OpenSSH_5.9 pat OpenSSH*
debug1:启用协议2.0的兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_5.9
debug1:SSH2\u MSG\u KEXINIT已发送
debug1:SSH2\u MSG\u KEXINIT已收到
debug1:kex:server->client aes128 ctr hmac-md5无
debug1:kex:客户端->服务器aes128 ctr hmac-md5无

debug1:SSH2\u MSG\u KEX\u DH\u GEX\u请求(1024由于您似乎有多个密钥,我将在
~/.ssh/config
中为特定连接分配特定密钥

例如:

Host local
    HostName 127.0.0.1
    Port 22
    User your_username
    IdentityFile ~/.ssh/your_key-id_rsa

然后尝试
ssh local

,因为您似乎有多个密钥,我将在
~/.ssh/config
中为特定连接分配特定密钥

例如:

Host local
    HostName 127.0.0.1
    Port 22
    User your_username
    IdentityFile ~/.ssh/your_key-id_rsa

然后尝试
ssh local

连接到
localhost
时,您似乎正在使用协议版本2.0,因此请尝试将
授权密钥
移动到
授权密钥2


来源:解释两个密钥文件之间的差异。

连接到
本地主机时,您似乎正在使用协议版本2.0,因此请尝试将
授权密钥
移动到
授权密钥2


来源:解释两个密钥文件之间的差异。

我遇到了相同的问题。我检查了系统密码和组文件,发现我的用户和组不存在。要生成此文件(我的用户是域用户),我需要在cygwin shell上运行两个命令:

mkpasswd -l -d > /etc/passwd

mkgroup -l -d > /etc/group
在那之后,ssh工作得很好


Elvys Borges

我也有同样的问题。我检查了系统密码和组文件,发现我的用户和组不存在。要生成此文件(我的用户是域用户),我需要在cygwin shell上运行两个命令:

mkpasswd -l -d > /etc/passwd

mkgroup -l -d > /etc/group
在那之后,ssh工作得很好


Elvys Borges

以及此连接尝试的sshd服务器日志中有什么内容?这是我从/var/log/system.log:Dec 5 16:52:04 phylaux4biologylseudu.local sshd[54115]:连接关闭时间::1[preauth]Dec 5 16:52:06 phylaux4biologylseudu.local netbiosd[109]:name servers down?是否有其他地方我应该查找sshd服务器日志?以及此连接尝试的sshd服务器日志中有什么内容?这是我从/var/log/system.log:Dec 5 16:52:04 phylaux4biologylseudu.local sshd[54115]:连接在以下时间关闭::1[preauth]Dec 5 16:52:06 phylaux4biologylseudu.local netbiosd[109]:名称服务器关闭?是否有其他地方我应该查找sshd服务器日志?