Linux OS Class [20170712x1] gnupg ssh-keygen use pgp

[mary@server0 ~]$ ll -a
total 24
drwx------. 5 mary mary 4096 Jul 12 21:00 .
drwxr-xr-x. 5 root root   43 Jul 12 19:47 ..
-rw-------. 1 mary mary  174 Jul 12 21:00 .bash_history
-rw-r--r--. 1 mary mary   18 Jan 29  2014 .bash_logout
-rw-r--r--. 1 mary mary  193 Jan 29  2014 .bash_profile
-rw-r--r--. 1 mary mary  231 Jan 29  2014 .bashrc
drwxrwxr-x. 3 mary mary   17 Jul 12 20:01 .cache
drwxr-xr-x. 3 mary mary   67 Jul 12 20:01 .config
drwxr-xr-x. 4 mary mary   37 Jan  7  2015 .mozilla
-rw-rw-r--. 1 mary mary 1395 Jul 12 20:10 secret
[mary@server0 ~]$ gpg --gen-key
gpg (GnuPG) 2.0.22; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: directory `/home/mary/.gnupg' created
gpg: new configuration file `/home/mary/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/mary/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/mary/.gnupg/secring.gpg' created
gpg: keyring `/home/mary/.gnupg/pubring.gpg' created
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 4096
Requested keysize is 4096 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 2w
Key expires at Wed 26 Jul 2017 09:32:04 PM CST
Is this correct? (y/N) y

GnuPG needs to construct a user ID to identify your key.

Real name: Mary Chen
Email address: mary@server0.example.com
Comment: Mary the Queen
You selected this USER-ID:
    "Mary Chen (Mary the Queen) <mary@server0.example.com>"

Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.
****open a dialog window


gpg: cancelled by user
gpg: Key generation canceled.

#####################################
ssh pgp login
pi@pi0:~ $ssh-keygen
pi@pi0:~ $ls -a

pi@pi0:~ $ cd .ssh
pi@pi0:~/.ssh $ ls
id_rsa   #is pgp key
id_rsa.pub      #is public key
known_hosts

$pi@pi0:~/.ssh $ ssh-copy-id pi@192.168.0.155
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
pi@192.168.0.155's password:

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'pi@192.168.0.155'"
and check to make sure that only the key(s) you wanted were added.

pi@pi0:~/.ssh $
pi@pi0:~/.ssh $
pi@pi0:~/.ssh $
pi@pi0:~/.ssh $
pi@pi0:~/.ssh $ ssh pi@192.168.0.155

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Jul 13 02:44:22 2017 from 192.168.0.152

SSH is enabled and the default password for the 'pi' user has not been changed.
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
$passwd -d pi  #remove the pi login passwd

留言

這個網誌中的熱門文章

Virtual Machine 中進行開發專案優點 => VM & Docker

Why not Python?

Linux OS Class [20170710] vmare new and resize command demo