Difference between revisions of "Making an ssh key"

From PrgmrWiki
(SSH programs)
(OpenSSH)
Line 13: Line 13:
 
<li>If openssh is not already installed, on Debian/Ubuntu try <pre>aptitude install openssh-client</pre>or on Redhat/CentOS<pre>yum install openssh-clients</pre> or download the portable source from [http://www.openssh.org/portable.html openssh.org] and compile it. When OpenSSH is setup you can generate a key and try to login.</li>
 
<li>If openssh is not already installed, on Debian/Ubuntu try <pre>aptitude install openssh-client</pre>or on Redhat/CentOS<pre>yum install openssh-clients</pre> or download the portable source from [http://www.openssh.org/portable.html openssh.org] and compile it. When OpenSSH is setup you can generate a key and try to login.</li>
 
<li><pre>
 
<li><pre>
$ ssh-keygen
+
$ ssh-keygen -t rsa -b 2048
 
Generating public/private rsa key pair.
 
Generating public/private rsa key pair.
 
Enter file in which to save the key (/home/nick/.ssh/id_rsa): /home/nick/thesshkey
 
Enter file in which to save the key (/home/nick/.ssh/id_rsa): /home/nick/thesshkey
Line 42: Line 42:
  
 
It is safe to share your public key with anyone. Never share your private key!
 
It is safe to share your public key with anyone. Never share your private key!
 +
 +
We support rsa, dsa, dss, and also ecdsa (on newer servers only). We recommend at least 2048 bits in your key (or 256 for ecdsa). We do not yet support ed25519. You can choose an alternate algorithm by using the -t flag.
  
 
== PuTTY ==
 
== PuTTY ==

Revision as of 23:31, 16 June 2015

SSH programs

The most popular ssh programs are OpenSSH for Linux and PuTTY for Windows.

If you have a key but need to convert it to OpenSSH format, see (this tutorial.)[1]

Some other programs are SecureCRT and xshell.

OpenSSH

(For Linux, Cygwin, or OS X)

  1. If openssh is not already installed, on Debian/Ubuntu try
    aptitude install openssh-client
    or on Redhat/CentOS
    yum install openssh-clients
    or download the portable source from openssh.org and compile it. When OpenSSH is setup you can generate a key and try to login.
  2. $ ssh-keygen -t rsa -b 2048
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/nick/.ssh/id_rsa): /home/nick/thesshkey
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/nick/thesshkey.
    Your public key has been saved in /home/nick/thesshkey.pub.
    The key fingerprint is:
    20:78:b9:01:15:3a:43:60:7b:7b:55:b3:7f:3b:a5:20 nick@theclient
    The key's randomart image is:
    +--[ RSA 2048]----+
    |.oo.o.   o       |
    |...+ .  . o      |
    | .=.= .. .       |
    |  .+.+..  .      |
    |   ...  SE o . . |
    |    .     . o +  |
    |             +   |
    |              .  |
    +-----------------+
    

    If you use the default key filename /home/nick/.ssh/id_rsa ssh will try to use it automatically.

  3. Email the public key (in this case /home/nick/thesshkey.pub) to support@prgmr.com with your username and other information.
  4. Once your account is setup with the public key, login to the server with your private key:
    nick@theclient:~/prgmr$ ssh -i /home/nick/thesshkey asdfasdf@theserver
    

It is safe to share your public key with anyone. Never share your private key!

We support rsa, dsa, dss, and also ecdsa (on newer servers only). We recommend at least 2048 bits in your key (or 256 for ecdsa). We do not yet support ed25519. You can choose an alternate algorithm by using the -t flag.

PuTTY

  1. Download the PuTTY installer and install it.
  2. Run PuTTYgen
  3. Generate a key
  4. Enter a passphrase for the private key.
  5. Save the public and private key files
  6. Email the public key file to support@prgmr.com.
  7. Set the private key file in PuTTY run PuTTY from the start menu instead of PuTTYgen
  8. Then save the setting to the Default Settings or a new profile under Saved Sessions and enter a hostname or username@hostname.
  9. Press open to connect to the server.