Linux 如何使用codecommit设置git,这样我就不必每次都添加ssh密钥id了?

Linux 如何使用codecommit设置git,这样我就不必每次都添加ssh密钥id了?,linux,git,ssh,ubuntu-14.04,aws-codecommit,Linux,Git,Ssh,Ubuntu 14.04,Aws Codecommit,我已经将我的ssh上传到aws,我可以在使用ubuntu时做到: git clone ssh://my-ssh-key-id@git-codecommit.xxx.amazonaws.com/v1/repos/yyy 但是,我不能复制粘贴codeCommit提供的repo url,而只使用它而不使用密钥id,如: git clone ssh://git-codecommit.xxx.amazonaws.com/v1/repos/yyy 我应该如何配置git或ssh来实现这一点?将以下内容添加

我已经将我的ssh上传到aws,我可以在使用ubuntu时做到:

git clone ssh://my-ssh-key-id@git-codecommit.xxx.amazonaws.com/v1/repos/yyy
但是,我不能复制粘贴codeCommit提供的repo url,而只使用它而不使用密钥id,如:

git clone ssh://git-codecommit.xxx.amazonaws.com/v1/repos/yyy

我应该如何配置git或ssh来实现这一点?

将以下内容添加到您的.ssh/config中就足够了


将以下内容添加到.ssh/config中就足够了


修改~/.ssh/config文件,使其具有如下内容:

Host git-codecommit.*.amazonaws.com
    User APKAEIBAERJR2EXAMPLE
    IdentityFile ~/.ssh/codecommit_rsa
其中,“User”是在IAM控制台中为IAM用户生成的SSH密钥ID,“IdentityFile”是您使用“SSH keygen”生成的RSA私钥文件的位置,该文件与IAM用户关联


来源:

修改~/.ssh/config文件,使其具有如下内容:

Host git-codecommit.*.amazonaws.com
    User APKAEIBAERJR2EXAMPLE
    IdentityFile ~/.ssh/codecommit_rsa
其中,“User”是在IAM控制台中为IAM用户生成的SSH密钥ID,“IdentityFile”是您使用“SSH keygen”生成的RSA私钥文件的位置,该文件与IAM用户关联

资料来源: