Host myserver HostName m Port 5555 IdentityFile /.ssh/id_rsa_xxx User bob Host mysecondserver HostName t Port 6666 IdentityFile /.ssh/id_rsa_zzz User slartibartfast Conclusions Related posts Name Email Website Settings Default Boring Hello Kitty External links in new tab Subscribe Follow Table of content Tag blob.htaccess, animate, array.
Git commit -m "your comments" git push, another related article in Chinese m/docs/multipleSSHkeys/.
Two files were created: id_rsa_xxx this is your key file that sits on the local machine.
Add more servers after the first one, if needed.But, by default halo combat evolved anniversary keyes terminal location the id_rsa.On your local machine, issue: ssh-keygen -t rsa, itll ask you where to big korean drama episode 15 eng sub save it, if this is the first key youre making, then just hit enter and itll make it in /Users/hilja/.ssh/id_rsa.Create another set of public and private keys, and copy the public key new_rsa.If you SSH to, private key /.ssh/id_rsa will be used.They would be tried in sequence (checkout man 5 ssh_config).Next it asks to game ban sung ak make a passphrase, what it means is that in addition you are required to type in a password when logging in with the key.Pub Login to the remote server and find the /.ssh/authorized_keys and paste it there.Email " or you can have global git config git config -global me "jexchan" git config -global user.If you dont have an /.ssh directory, go ahead and make it: mkdir /.ssh, second step: setup an ssh key.Now you have the key, go ahead and pop it open to a text editor, or cat it cat id_rsa_xxx, it should look something like this: -begin RSA private KEY-, -END RSA private KEY- And the public file looks approximately like this: ssh-rsa [email protected] Third.
Pub to another server, for example.
Pub [email protected] Method #2 This is more verbose but Ive found it very successful: cat /.ssh/id_rsa_xxx.
First step: check for SSH keys ls -al /.ssh # This shows all your keys, if there is any.Plus it's easy to manage multiple keys with a config file.Email " git config me "activehacker" git config user.Then added #activehacker account, host m-activehacker HostName m User git IdentityFile /.ssh/id_rsa_activehacker #jexchan account, host m-jexchan HostName m User git IdentityFile /.ssh/id_rsa_jexchan.Config file config file lives in /.ssh/config, if its not there, go ahead and make.Pub this is the public file that goes to your remote server.To allow multiple private keys connect to different servers, edit /.ssh/config : /.ssh/config, host, identityFile /.ssh/linode_rsa, host, identityFile /.ssh/id_rsa.Pub ssh -p 5555 [email protected] "mkdir -p /.ssh cat /.ssh/authorized_keys" Note that a port is specified -p 5555, if you have your ssh listening to a default port, you might not need that.Method #3 Just copy and paste manually the public key, cat it out and just copy it: cat /.ssh/id_rsa_xxx.