• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[TUT] Fast Logins with ssh keys

Skrbx

BETA Tester
If you have to manage multiply servers via SSH is really annoying to type same password over and over again. The public key exchange can be used for a secure alternative of typing password on each login.
Here is quick tutorial how to do it:

1) First you need to generate private/public key, so enter this command:

Code:
ssh-keygen -t rsa

The script will ask you to enter a passphrase two times and it will generate two files: ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub (where "~" is a shortcut to user's home directory).

2) Now to use this keypair on a server, try this run this command:

Code:
$ ssh server "mkdir .ssh; chmod 0700 .ssh"
$ scp .ssh/id_rsa.pub server:.ssh/authorized_keys
Now you just need to ssh the server. It won't require pass for most of the operations between this two computers.
 

Hyperion

Founder
If you work with multiple servers, ssh keys are the best to use. Even when you do the extra tweaks with hostnames to just do ": ssh box1" and "ssh box2" to switch around.
When I had a set of Linux servers, I just set them up so I could do "goto server1, goto server2, goto server3" between them, was a huge time saver in the end.

Thanks for sharing the how-to
 
Top