Diferencia entre revisiones de «Comandos de la terminal/ssh-keygen»

De WikiCabal
Ir a la navegación Ir a la búsqueda
 
(Sin diferencias)

Revisión actual del 20:54 28 nov 2014

ssh-keygen

     ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
                [-f output_keyfile]
     ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
     ssh-keygen -i [-m key_format] [-f input_keyfile]
     ssh-keygen -e [-m key_format] [-f input_keyfile]
     ssh-keygen -y [-f input_keyfile]
     ssh-keygen -c [-P passphrase] [-C comment] [-f keyfile]
     ssh-keygen -l [-f input_keyfile]
     ssh-keygen -B [-f input_keyfile]
     ssh-keygen -D pkcs11
     ssh-keygen -F hostname [-f known_hosts_file] [-l]
     ssh-keygen -H [-f known_hosts_file]
     ssh-keygen -R hostname [-f known_hosts_file]
     ssh-keygen -r hostname [-f input_keyfile] [-g]
     ssh-keygen -G output_file [-v] [-b bits] [-M memory] [-S start_point]
     ssh-keygen -T output_file -f input_file [-v] [-a num_trials]
                [-J num_lines] [-j start_line] [-K checkpt] [-W generator]
     ssh-keygen -s ca_key -I certificate_identity [-h] [-n principals]
                [-O option] [-V validity_interval] [-z serial_number] file ...
     ssh-keygen -L [-f input_keyfile]
     ssh-keygen -A
     ssh-keygen -k -f krl_file [-u] [-s ca_public] [-z version_number]
                file ...
     ssh-keygen -Q -f krl_file file ...

[rrc@Llawyr ~]$ su -c "rpm -qf $( which ssh-keygen )"
Password: 
openssh-6.2p2-3.2.mga4

[rrc@Llawyr ~]$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/rrc/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/rrc/.ssh/id_rsa.
Your public key has been saved in /home/rrc/.ssh/id_rsa.pub.
The key fingerprint is:
9d:12:eb:3f:4e:90:96:c5:cd:16:de:b7:2b:b1:46:e9 rrc@Llawyr.LinuxCabal.org
The key's randomart image is:
+--[ RSA 2048]----+
|            .    |
|         . + o   |
|        . o = . .|
|         B o  ...|
|        S o  + . |
|       o o  o o .|
|        . .  E . |
|         o. . .  |
|         .o.     |
+-----------------+
[rrc@Llawyr ~]$ ls -al .ssh/
total 24
drwx------  2 rrc rrc 4096 Nov 28 14:13 ./
drwxr-x--x 46 rrc rrc 4096 Nov 28 14:09 ../
-rw-------  1 rrc rrc 1679 Nov 28 14:13 id_rsa
-rw-------  1 rrc rrc  407 Nov 28 14:13 id_rsa.pub
-rw-r--r--  1 rrc rrc 6039 Nov 21 16:14 known_hosts

[rrc@Llawyr .ssh]$ ssh-keygen -l
Enter file in which the key is (/home/rrc/.ssh/id_rsa): 
2048 51:9b:23:01:38:9b:df:1a:32:3f:f7:57:54:33:26:7e  rrc@Llawyr.LinuxCabal.org (RSA)

[rrc@Llawyr ~]$ ssh-copy-id -i .ssh/id_rsa.pub rrc@priddwifi
15

                      Bienvenido a Pridd.LinuxCabal.org
                       Welcome to Pridd.LinuxCabal.org
                   Soyez bienvenus a  Pridd.LinuxCabal.org

                 AVISO: Estamos supervisando su comportamiento
                  WARNING:  We are monitoring this connection
                AVERTISSEMENT: Nous controlons cette connexion

                         El abuso no va a ser tolerado
                          Abuse will NOT be tolerated
                           L'abus ne sera pas tolere

Password: 
Now try logging into the machine, with "ssh 'rrc@priddwifi'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[rrc@Llawyr ~]$ ssh rrc@priddwifi

                      Bienvenido a Pridd.LinuxCabal.org
                       Welcome to Pridd.LinuxCabal.org
                   Soyez bienvenus a  Pridd.LinuxCabal.org

                 AVISO: Estamos supervisando su comportamiento
                  WARNING:  We are monitoring this connection
                AVERTISSEMENT: Nous controlons cette connexion

                         El abuso no va a ser tolerado
                          Abuse will NOT be tolerated
                           L'abus ne sera pas tolere

Last login: Fri Nov 28 13:24:27 2014 from 192.168.51.57

[rrc@pridd ~]$ cd .ssh/

[rrc@pridd .ssh]$ ls -al
total 16
drwx------  2 rrc rrc 4096 Nov 28 14:16 ./
drwxr-x--x 55 rrc rrc 4096 Nov 28 14:16 ../
-rw-r--r--  1 rrc rrc  407 Nov 28 14:16 authorized_keys
-rw-r--r--  1 rrc rrc 3417 Nov 26 23:20 known_hosts

[rrc@pridd .ssh]$ cat authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMiIJYdrnmhDh1qBXqjQK6B3cfwPiqTe+5DHx0jQyFirkLCmrUXsNk4oG7SS4Vw5LkNj3hKQFchivOQniGO267bz1RNn1LQsJ82VMd9sA6af1uMuspDZ+Yem0NeOFIcUZqUXxXZck0209JisizkWZcLO1T093WXreR/cWs+TEZrniVjeyleSMeBn62vPQsu1bPAJT6TSaL5fYhm2BDLIpj4tyyWbxC3kxbbR5T+txjTF/DPvdI34x2XrC4ykTQPS0hT3wmYtIsiPX7Bqv7SzblizQphsaY2QIjm1IXJVTEnfqVZZpSMVCCLGD+Xplw5CvJtlDebBHGjQY7jhMyN/dX rrc@Llawyr.LinuxCabal.org
^d

[rrc@Llawyr ~]$ ssh-copy-id rrc@www

                      Bienvenido a www.LinuxCabal.org
                       Welcome to www.LinuxCabal.org
                   Soyez bienvenus a  www.LinuxCabal.org

                 AVISO: Estamos supervisando su comportamiento
                  WARNING:  We are monitoring this connection
                AVERTISSEMENT: Nous controlons cette connexion

                         El abuso no va a ser tolerado
                          Abuse will NOT be tolerated
                           L'abus ne sera pas tolere

Password: 
Now try logging into the machine, with "ssh 'rrc@www'", and check in:

  .ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[rrc@Llawyr ~]$ scp -3 rrc@priddwifi:Titles rrc@www:

                      Bienvenido a Pridd.LinuxCabal.org
                       Welcome to Pridd.LinuxCabal.org
                   Soyez bienvenus a  Pridd.LinuxCabal.org

                 AVISO: Estamos supervisando su comportamiento
                  WARNING:  We are monitoring this connection
                AVERTISSEMENT: Nous controlons cette connexion

                         El abuso no va a ser tolerado
                          Abuse will NOT be tolerated
                           L'abus ne sera pas tolere


                           Bienvenido a www.imat.com
                            Welcome to www.imat.com
                        Soyez bienvenus a  www.imat.com

                 AVISO: Estamos supervisando su comportamiento
                  WARNING:  We are monitoring this connection
                AVERTISSEMENT: Nous controlons cette connexion

                         El abuso no va a ser tolerado
                          Abuse will NOT be tolerated
                           L'abus ne sera pas tolere

[rrc@Llawyr ~]$