Managing Multiple SSH Keys
From Do you speak Drupalish? Featured Drupal wiki-like documentation
Contents
Easy
Just generate more Ssh_public_private_keys#Generate with different namesalways get the default
Connect from
- http://www.robotgoblin.co.uk/blog/2012/07/24/managing-multiple-ssh-keys/
- http://stackoverflow.com/questions/2419566/best-way-to-use-multiple-ssh-private-keys-on-one-client
vi /etc/ssh/ssh_config Host 192.168.0.7 test HostName 192.168.0.7 IdentityFile ~/.ssh/realname_rsa User remoteusername Port xxxx Host myother realname2.example.org HostName realname2.example.org IdentityFile ~/.ssh/realname2_rsa User remoteusername
Tips
- check with hostnamewhere are you
Connect to
- Make a .ssh directory in your non-root user home directory. Put the key in a file called ~/.ssh/authorized keys. Do the same for every user user. http://serverfault.com/questions/555516/setup-public-key-authorized-ssh-for-non-root-users
- Otherwise you get Server refused our key
- mkdir -p /home/limited/.ssh
- chown -R limited:limited /home/limited/.ssh
- ssh-keygen -t rsa -b 4096
Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /home/limited/.ssh/id_rsa
- see pattern
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 # but this is overridden so installations will only check .ssh/authorized_keys AuthorizedKeysFile .ssh/authorized_keys