Unix Command/output | Meaning/Comment |
---|
[mdoyle@hydraSERVERNAME ~]$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/mdoyleusername/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/mdoyleusername/.ssh/id_rsa. Your public key has been saved in /home/mdoyleusername/.ssh/id_rsa.pub. | Generate the key. Do not specify a password to allow for use in scripts without user input. |
[mdoyle@hydraSERVERNAME ~]$ scp .ssh/id_rsa.pub mike@10.0.1.3: Password for mike@mc: id_rsa.pub 100% 411 0.4KB/s 00:00 | Copy the key to the remote host. You WILL be prompted for your password.
|
[mdoyle@hydraSERVERNAME ~]$ ssh mike@10.0.1.3 Password for mike@mc:
Last login: Tue Sep 12 14:25:36 2017 from 10.0.1.1 Welcome to FreeBSD!
| Log in to the remote host, enter your password (for the last time) |
[mike@mcusername@mc ~]$ cat id_rsa.pub >> .ssh/authorized_keys [mike@mcusername@mc ~]$ chmod 600 .ssh/authorized_keys [mike@mcusername@mc ~]$ rm id_rsa.pub [mike@mcusername@mc ~]$ logout Connection to 10.0.1.3 closed. | Append the key to the authorized keys file |
[mdoyle@hydraSERVERNAME ~]$ ssh mike@10.0.1.3 Last login: Tue Sep 12 14:29:45 2017 from 10.0.1.1 Welcome to FreeBSD! | Now you log in with no password prompt |