...
On Linux/Unix machine:
The command to generate an ssh key file is "ssh-keygen". Used without any parameters it will usually generate an SSH2 version RSA key. Additional options are available. See "man ssh-keygen (FreeBSD version)" for more details. (Most BSD and Linux distributions use OpenSSH or derivatives)
On a Windows computer you will probably be using either PuTTY or BitviseSSH clients, and they each have their own way to generate a set of public and private key. You may need to take an extra step to export the private key in OpenSSH format.
For example, with PuttyGen, after you have created your key, choose the "Conversions" menu and select Export OpenSSH Key (Force New Format) - this is the key you will use in iQSonar.
...
If the username is iQSonar, then the hidden folder .ssh will be located in /home/iQSonar/.ssh typically on Linux/Unix hosts.
...
No Format |
---|
[ |
...
SERVERNAME ~]$ ssh-keygen |
...
|
...
Generating public/private rsa key pair. |
...
Enter file in which to save the key (/home/ |
...
username/.ssh/id_rsa): |
...
Enter passphrase (empty for no passphrase): |
...
Enter same passphrase again: |
...
|
...
Your identification has been saved in /home/ |
...
username/.ssh/id_rsa. |
...
|
...
Your public key has been saved in /home/ |
...
username/.ssh/id_rsa.pub. |
...
|
...
The key fingerprint is: |
...
|
...
c0:bf:33:bd:f3:5a:8b:32:48:82:85:51:3e:18:6b:fa mdoyle@hydra |
Note that two files are created. The public key (which is copied to the remote server) and the private key (which is stored on your computer)
...
Unix Command/output | Meaning/Comment |
---|---|
[mdoyle@hydraSERVERNAME ~]$ ssh-keygen | 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: | Copy the key to the remote host. You WILL be prompted for your password. |
[mdoyle@hydraSERVERNAME ~]$ ssh mike@10.0.1.3 | Log in to the remote host, enter your password (for the last time) |
[mike@mcusername@mc ~]$ cat id_rsa.pub >> .ssh/authorized_keys | Append the key to the authorized keys file |
[mdoyle@hydraSERVERNAME ~]$ ssh mike@10.0.1.3 | Now you log in with no password prompt |
...