ssh未使用主目录中的配置文件

ssh未使用主目录中的配置文件,ssh,aws-codecommit,Ssh,Aws Codecommit,使用: OpenSSH_6.2p2,OSSLShim 0.9.8r 2011年12月8日 OSX:10.10.5 我正在跟踪调查 我的配置文件如下所示: HostName git-codecommit.us-east-1.amazonaws.com User <myuserid that is supplied from aws is here> IdentityFile ~/.ssh/codecommit_rsa HostName git-codecommit.us-

使用:

  • OpenSSH_6.2p2,OSSLShim 0.9.8r 2011年12月8日
  • OSX:10.10.5
我正在跟踪调查

我的配置文件如下所示:

HostName git-codecommit.us-east-1.amazonaws.com
  User <myuserid that is supplied from aws is here>
  IdentityFile ~/.ssh/codecommit_rsa
HostName git-codecommit.us-east-1.amazonaws.com
使用者
IdentityFile~/.ssh/codecommit\u rsa
但是它没有访问本地配置文件。它一直在寻找id_rsa,我的权限被拒绝(公钥)。我可以使用ssh的唯一方法是手动运行:

ssh -i codecommit_rsa <myuserid from amazon>@git-codecommit.us-east-1.amazonaws.com
ssh-i codecommit\u rsa@git-codecommit.us-east-1.amazonaws.com
从ssh-v:

CLI-24420:.ssh nsturgess$ ssh -v git-codecommit.us-east-1.amazonaws.com
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to git-codecommit.us-east-1.amazonaws.com [54.239.20.155] port 22.
debug1: Connection established.
debug1: identity file /Users/nsturgess/.ssh/id_rsa type -1
debug1: identity file /Users/nsturgess/.ssh/id_rsa-cert type -1
debug1: identity file /Users/nsturgess/.ssh/id_dsa type -1
debug1: identity file /Users/nsturgess/.ssh/id_dsa-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version AWSCodeCommit VHVlLCAxMiBKYW4gMjAxNiAyMTo1NjowMCArMDAwMOVgljlXewI0PWsqvMExhuwd1npoXpT8tFGX2PJoBfPLVW
debug1: no match: AWSCodeCommit VHVlLCAxMiBKYW4gMjAxNiAyMTo1NjowMCArMDAwMOVgljlXewI0PWsqvMExhuwd1npoXpT8tFGX2PJoBfPLVWh2dkRHbCtza1J3WWNXVWNVU2llek9SZ0MvU24yS1lLdGQxTUFGOTNOeEU9
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<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 a6:9c:7d:bc:35:f5:d4:5f:8b:ba:6f:c8:bc:d4:83:84
debug1: Host 'git-codecommit.us-east-1.amazonaws.com' is known and matches the RSA host key.
debug1: Found key in /Users/nsturgess/.ssh/known_hosts:1
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
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/nsturgess/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/nsturgess/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: /Users/nsturgess/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: codecommit_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/nsturgess/.ssh/id_rsa
debug1: Trying private key: /Users/nsturgess/.ssh/id_dsa
debug1: No more authentication methods to try.
Permission denied (publickey).
CLI-24420:.ssh-nsturges$ssh-v git-codecommit.us-east-1.amazonaws.com
OpenSSH_6.2p2,OSSLShim 0.9.8r 2011年12月8日
debug1:读取配置数据/etc/ssh\u config
debug1:/etc/ssh\u配置第20行:应用*
debug1:连接到git-codecommit.us-east-1.amazonaws.com[54.239.20.155]端口22。
debug1:已建立连接。
debug1:identity file/Users/nsturges/.ssh/id\u rsa type-1
debug1:identity file/Users/nsturges/.ssh/id\u rsa-cert类型-1
debug1:identity file/Users/nsturges/.ssh/id_dsa type-1
debug1:identity file/Users/nsturges/.ssh/id_dsa-cert type-1
debug1:启用协议2.0的兼容模式
debug1:本地版本字符串SSH-2.0-OpenSSH_6.2
调试1:远程协议版本2.0,远程软件版本AWSCodeCommit VHVLLCAXMIBKYW4GMJAXNIAMYTONJOWMCARMDAWMOVGLJLXEWI0PWSQVMEXHUWD1NPOPEXPT8TFGX2PJOBFPLWW
调试1:不匹配:AWSCodeCommit VHVLLCAXMIBKYW4GMJAXNIAYTONJOWMCARMDAWMOVGLJLXEWI0PWSQVMEXHUWD1NPEXPT8TFGX2PJOBFPLVWH2DKRHBCTZA1J3WWNxVWWWWWU2LLEK9SZ0MVU24YS1LDGQXTUFOTNOEU9
debug1:SSH2\u MSG\u KEXINIT已发送
debug1:SSH2\u MSG\u KEXINIT已收到
debug1:kex:server->client aes128 ctr hmac-sha1无
debug1:kex:客户端->服务器aes128 ctr hmac-sha1无

debug1:SSH2\u MSG\u KEX\u DH\u GEX\u请求(1024解决方案是,由于某些原因,创建时的配置文件是为root用户创建的,因此在更改所有权后,它工作了!

您的配置文件存储在哪里?配置文件上的权限是什么?从
ssh-vvv…
发布详细日志。配置文件位于~/.ssh中,并且已通过600I请求
-vvv
查看更详细的日志。可能还有更隐藏的内容。某些内容阻止读取该文件。目录
~/.ssh/
本身的权限是什么?手动指定配置文件是否有效?
ssh-F~/.ssh/config
我也面临同样的问题。请解释一下您是如何更改所有权的?