Ssh key authentication. Specifying alternative identity files (like id_rsa) for different hostsBy neokrates, written on September 2, 2010
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 23
You have different keypairs, one per host. Here is how you can setup ssh to use them with right hosts
ls -Al ~/.ssh:
... -rw------- 1 slave1 hudson 667 Sep 1 16:33 id_dsa_git_readonly -rw------- 1 slave1 hudson 667 Sep 1 16:33 id_dsa_svn -rw------- 1 slave1 hudson 667 Sep 1 16:33 id_dsa_nexus ...
There are 3 hosts where you need to be authenticated:
gitorious.your.corp, svn.your.corp, nexus.your.corp
~/.ssh/config file with:
Host gitorious Hostname gitorious.your.corp User git PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa_git_readonly Host svn Hostname svn.your.corp User yoursvnuser PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa_svn Host nexus Hostname nexus.your.corp User yournexususer PreferredAuthentications publickey IdentityFile ~/.ssh/id_dsa_nexus
Now, we have configured openssh to be aware of three hosts, and to use specified
publickeys for each.
That’s it, have fun!
INCOMING SEARCH TERMS