【发布时间】:2019-01-19 09:28:14
【问题描述】:
每个 git 存储库都有一个 SSH 密钥。我在 Bitbucket 和 Gitlab 上有存储库。我在 Ubuntu 18.04 LTS 下。如果我将这些密钥与ssh-add 一起使用,它可以工作,但我不想每次都使用ssh-add 我所有的密钥及其密码。我最多想在 Ubuntu 开始做一次。这是我配置中有趣的部分,我绝望地输入了/etc/ssh/ssh_config,以确保没有权利问题:
AddKeysToAgent yes
Host git@bitbucket.org:mysthiq/blog.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/Blog/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/guetzlifolder.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/GuetzliFolder/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/portfolio.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/portfolio/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/framework-cms.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/portfolio/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/medoucine.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/medoucine/cle-ssh-linux
IdentitiesOnly yes
Host git@gitlab.wexample.com:oef/contests.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/vinalies1.3/cle-ssh-linux
IdentitiesOnly yes
Host git@gitlab.wexample.com:oef/mobile_v1.3.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/oef/mobile/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/phpbench.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/phpbench/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/prevandcare.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/PrevAndCare/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/sfboilerplate.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/sfBoilerPlate/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/sitesize.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/SiteSize/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/vinalies.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/vinalies/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/vinalies1.3.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/vinalies1.3/cle-ssh-linux
IdentitiesOnly yes
Host git@bitbucket.org:mysthiq/vinciaprep.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/vinciaprep/cle-ssh-linux
IdentitiesOnly yes
Host git@gitlab.wexample.com:wexample-public/scripts.git
UseKeychain yes
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/Wexample/cle-ssh-linux
IdentitiesOnly yes
如果我能知道一种方法来快速测试我的 ssh 配置,而不必每次进行更改时都重新启动 ubuntu,我也会很高兴。 (目标是将这些项目与 PHPStorm 一起使用。)
【问题讨论】:
标签: git ssh passphrase