SSHM-bM-^@M-^PKEYGEN(1) BSD General Commands Manual SSHM-bM-^@M-^PKEYGEN(1) ^[[1mNAME^[[0m ^[[1msshM-bM-^@M-^Pkeygen ^[[22mM-bMM-^R authentication key generation, management and conversion ^[[1mSYNOPSIS^[[0m ^[[1msshM-bM-^@M-^Pkeygen ^[[22m[^[[1mM-bMM-^Rq^[[22m] [^[[1mM-bMM-^Rb ^[[4m^[[22mbits^[[24m] ^[[1mM-bMM-^Rt ^[[4m^[[22mtype^[[24m [^[[1mM-bMM-^RN ^[[4m^[[22mnew_passphrase^[[24m] [^[[1mM-bMM-^RC ^[[4m^[[22mcomment^[[24m] [^[[1mM-bMM-^Rf ^[[4m^[[22moutput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Rp ^[[22m[^[[1mM-bMM-^RP ^[[4m^[[22mold_passphrase^[[24m] [^[[1mM-bMM-^RN ^[[4m^[[22mnew_passphrase^[[24m] [^[[1mM-bMM-^Rf ^[[4m^[[22mkeyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Ri ^[[22m[^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Re ^[[22m[^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Ry ^[[22m[^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Rc ^[[22m[^[[1mM-bMM-^RP ^[[4m^[[22mpassphrase^[[24m] [^[[1mM-bMM-^RC ^[[4m^[[22mcomment^[[24m] [^[[1mM-bMM-^Rf ^[[4m^[[22mkeyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^Rl ^[[22m[^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^RB ^[[22m[^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^RD ^[[4m^[[22mreader^[[0m ^[[1msshM-bM-^@M-^Pkeygen M-bMM-^RU ^[[4m^[[22mreader^[[24m [^[[1mM-bMM-^Rf ^[[4m^[[22minput_keyfile^[[24m] ^[[1mDESCRIPTION^[[0m ^[[1msshM-bM-^@M-^Pkeygen ^[[22mgenerates, manages and converts authentication keys for ssh(1). ^[[1msshM-bM-^@M-^Pkeygen ^[[22mcan create RSA keys for use by SSH protocol version 1 and RSA or DSA keys for use by SSH protocol version 2. The type of key to be generated is specified with the ^[[1mM-bMM-^Rt ^[[22moption. Normally each user wishing to use SSH with RSA or DSA authentication runs this once to create the authentication key in ^[[4m$HOME/.ssh/identity^[[24m, ^[[4m$HOME/.ssh/id_dsa^[[24m or ^[[4m$HOME/.ssh/id_rsa^[[24m. Additionally, the system adminM-bM-^@M-^P istrator may use this to generate host keys, as seen in ^[[4m/etc/rc^[[24m. Normally this program generates the key and asks for a file in which to store the private key. The public key is stored in a file with the same name but M-bM-^@M-^\.pubM-bM-^@M-^] appended. The program also asks for a passphrase. The passphrase may be empty to indicate no passphrase (host keys must have an empty passphrase), or it may be a string of arbitrary length. A passphrase is similar to a password, except it can be a phrase with a series of words, punctuation, numbers, whitespace, or any string of charM-bM-^@M-^P acters you want. Good passphrases are 10M-bM-^@M-^P30 characters long, are not simple sentences or otherwise easily guessable (English prose has only 1M-bM-^@M-^P2 bits of entropy per character, and provides very bad passphrases), and contain a mix of upper and lowercase letters, numbers, and nonM-bM-^@M-^P alphanumeric characters. The passphrase can be changed later by using the ^[[1mM-bMM-^Rp ^[[22moption. There is no way to recover a lost passphrase. If the passphrase is lost or forgotten, a new key must be generated and copied to the corresponding public key to other machines. For RSA1 keys, there is also a comment field in the key file that is only for convenience to the user to help identify the key. The comment can tell what the key is for, or whatever is useful. The comment is initialM-bM-^@M-^P ized to M-bM-^@M-^\user@hostM-bM-^@M-^] when the key is created, but can be changed using the ^[[1mM-bMM-^Rc ^[[22moption. After a key is generated, instructions below detail where the keys should be placed to be activated. The options are as follows: ^[[1mM-bMM-^Rb ^[[4m^[[22mbits^[[0m Specifies the number of bits in the key to create. Minimum is 512 bits. Generally, 1024 bits is considered sufficient. The default is 1024 bits. ^[[1mM-bMM-^Rc ^[[22mRequests changing the comment in the private and public key files. This operation is only supported for RSA1 keys. The proM-bM-^@M-^P gram will prompt for the file containing the private keys, for the passphrase if the key has one, and for the new comment. ^[[1mM-bMM-^Re ^[[22mThis option will read a private or public OpenSSH key file and print the key in a M-bM-^@M-^XSECSH Public Key File FormatM-bM-^@M-^Y to stdout. This option allows exporting keys for use by several commercial SSH implementations. ^[[1mM-bMM-^Rf ^[[4m^[[22mfilename^[[0m Specifies the filename of the key file. ^[[1mM-bMM-^Ri ^[[22mThis option will read an unencrypted private (or public) key file in SSH2M-bM-^@M-^Pcompatible format and print an OpenSSH compatible private (or public) key to stdout. ^[[1msshM-bM-^@M-^Pkeygen ^[[22malso reads the M-bM-^@M-^XSECSH Public Key File FormatM-bM-^@M-^Y. This option allows importing keys from several commercial SSH implementations. ^[[1mM-bMM-^Rl ^[[22mShow fingerprint of specified public key file. Private RSA1 keys are also supported. For RSA and DSA keys ^[[1msshM-bM-^@M-^Pkeygen ^[[22mtries to find the matching public key file and prints its fingerprint. ^[[1mM-bMM-^Rp ^[[22mRequests changing the passphrase of a private key file instead of creating a new private key. The program will prompt for the file containing the private key, for the old passphrase, and twice for the new passphrase. ^[[1mM-bMM-^Rq ^[[22mSilence ^[[1msshM-bM-^@M-^Pkeygen^[[22m. Used by ^[[4m/etc/rc^[[24m when creating a new key. ^[[1mM-bMM-^Ry ^[[22mThis option will read a private OpenSSH format file and print an OpenSSH public key to stdout. ^[[1mM-bMM-^Rt ^[[4m^[[22mtype^[[0m Specifies the type of the key to create. The possible values are M-bM-^@M-^\rsa1M-bM-^@M-^] for protocol version 1 and M-bM-^@M-^\rsaM-bM-^@M-^] or M-bM-^@M-^\dsaM-bM-^@M-^] for protocol version 2. ^[[1mM-bMM-^RB ^[[22mShow the bubblebabble digest of specified private or public key file. ^[[1mM-bMM-^RC ^[[4m^[[22mcomment^[[0m Provides the new comment. ^[[1mM-bMM-^RD ^[[4m^[[22mreader^[[0m Download the RSA public key stored in the smartcard in ^[[4mreader^[[24m. ^[[1mM-bMM-^RN ^[[4m^[[22mnew_passphrase^[[0m Provides the new passphrase. ^[[1mM-bMM-^RP ^[[4m^[[22mpassphrase^[[0m Provides the (old) passphrase. ^[[1mM-bMM-^RU ^[[4m^[[22mreader^[[0m Upload an existing RSA private key into the smartcard in ^[[4mreader^[[24m. ^[[1mFILES^[[0m $HOME/.ssh/identity Contains the protocol version 1 RSA authentication identity of the user. This file should not be readable by anyone but the user. It is possible to specify a passphrase when generating the key; that passphrase will be used to encrypt the private part of this file using 3DES. This file is not automatically accessed by ^[[1msshM-bM-^@M-^Pkeygen ^[[22mbut it is offered as the default file for the private key. ssh(1) will read this file when a login attempt is made. $HOME/.ssh/identity.pub Contains the protocol version 1 RSA public key for authenticaM-bM-^@M-^P tion. The contents of this file should be added to ^[[4m$HOME/.ssh/authorized_keys^[[24m on all machines where the user wishes to log in using RSA authentication. There is no need to keep the contents of this file secret. $HOME/.ssh/id_dsa Contains the protocol version 2 DSA authentication identity of the user. This file should not be readable by anyone but the user. It is possible to specify a passphrase when generating the key; that passphrase will be used to encrypt the private part of this file using 3DES. This file is not automatically accessed by ^[[1msshM-bM-^@M-^Pkeygen ^[[22mbut it is offered as the default file for the private key. ssh(1) will read this file when a login attempt is made. $HOME/.ssh/id_dsa.pub Contains the protocol version 2 DSA public key for authenticaM-bM-^@M-^P tion. The contents of this file should be added to ^[[4m$HOME/.ssh/authorized_keys^[[24m on all machines where the user wishes to log in using public key authentication. There is no need to keep the contents of this file secret. $HOME/.ssh/id_rsa Contains the protocol version 2 RSA authentication identity of the user. This file should not be readable by anyone but the user. It is possible to specify a passphrase when generating the key; that passphrase will be used to encrypt the private part of this file using 3DES. This file is not automatically accessed by ^[[1msshM-bM-^@M-^Pkeygen ^[[22mbut it is offered as the default file for the private key. ssh(1) will read this file when a login attempt is made. $HOME/.ssh/id_rsa.pub Contains the protocol version 2 RSA public key for authenticaM-bM-^@M-^P tion. The contents of this file should be added to ^[[4m$HOME/.ssh/authorized_keys^[[24m on all machines where the user wishes to log in using public key authentication. There is no need to keep the contents of this file secret. ^[[1mAUTHORS^[[0m OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, reM-bM-^@M-^Padded newer features and creM-bM-^@M-^P ated OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. ^[[1mSEE ALSO^[[0m ssh(1), sshM-bM-^@M-^Padd(1), sshM-bM-^@M-^Pagent(1), sshd(8) J. Galbraith and R. Thayer, ^[[4mSECSH^[[24m ^[[4mPublic^[[24m ^[[4mKey^[[24m ^[[4mFile^[[24m ^[[4mFormat^[[24m, draftM-bM-^@M-^PietfM-bM-^@M-^P secshM-bM-^@M-^PpublickeyfileM-bM-^@M-^P01.txt, March 2001, work in progress material. BSD September 25, 1999 BSD