HOW TO ADD AN SSH KEY LIKE A DUMMY:
So if you have a client machine and you want to give them access to your server do this.
ssh-keygenGenerating public/private rsa key pair.Enter file in which to save the key (/Users/client/.ssh/id_rsa): /Users/client/.ssh/new_keyEnter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /Users/client/.ssh/new_key.Your public key has been saved in /Users/client/.ssh/new_key.pub.
This generates two files:
/Users/client/.ssh/new_key (private)/Users/client/.ssh/new_key.pub (public)
Now you must copy the public key to the server of interest. On the server after you have copied the local file you can append to the
cat /home/john/new_key.pub >> /home/john/.ssh/authorized_keysNow the user can login using their private key.
ssh -i /Users/client/.ssh/new_key john@myserver.com
No comments:
Post a Comment