Ssh key authentication. Specifying alternative identity files (like id_rsa) for different hostsBy neokrates, written on September 2, 2010 |
howto |
- neokrates
- Email: uwarov@yahoo.com
- Website: http://www.thinkplexx.com
- Join date: 05-31-09
- Posts: 20
Rate it
Ad
Poll
Best shells (or command line language) are?
- Bash (47%, 9 Votes)
- Different shell (21%, 4 Votes)
- Zsh (21%, 4 Votes)
- Csh (11%, 2 Votes)
- Power shell (5%, 1 Votes)
- Ksh (5%, 1 Votes)
- Lush (0%, 0 Votes)
- Quicksilver (0%, 0 Votes)
- IPython (0%, 0 Votes)
- Rush (0%, 0 Votes)
- Pash (0%, 0 Votes)
- Dos cl (0%, 0 Votes)
- Fish shell (0%, 0 Votes)
Total Voters: 19
Loading ...
Most popular search terms:
You have different keypairs, one per host. Here is how you can setup ssh to use them with right hosts
Works for:
OpenSSH
any OS
Given 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
Add a ~/.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!
|
LEARN MORE (amazon bookstore)
|
|
TAGS
|
|
SOCIAL
|
|
INCOMING SEARCH TERMS
|


















