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

  • 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/ | 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.    


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

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