DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Send Your SSH Public Key To Each Host You Use

04.29.2005
| 19573 views |
  • submit to reddit
        if you do not already have a key pair
$ ssh-keygen -t dsa

send your public key to each host you ssh into
$ cat ~/.ssh/id_dsa.pub | ssh you@host 'cat - >> ~/.ssh/authorized_keys2'

now you can use ssh-agent and ssh-add to facilitate a "single signon" situation.

useful if you're ssh'ing into a bunch of machines all day.

google ssh-agent for distribution-specific details.    

Comments

Snippets Manager replied on Tue, 2007/07/24 - 1:56am

much nicer is ssh-copy-id also, keychain is great for ssh-agent management