For navigation help, press ?
For speaker view and notes, press S
For full-screen, press F
What is SSH?
Secure Shell
Remote Server
More Secure than rsh
More Secure than telnet
More Than a Shell
Run ssh
Install OpenSSH
ssh stage.cpantesters.org
doug@local:~$ ssh stage.cpantesters.org
doug@local:~$ ssh stage.cpantesters.org
The authenticity of host 'stage.cpantesters.org (2607:f740:f::914)' can't
be established.
ECDSA key fingerprint is SHA256:AcGEg+DDHplQT8Cc02CYy8Y4p/C4I5ARoEhrA5ZvrOQ.
Are you sure you want to continue connecting (yes/no)? yes
doug@local:~$ ssh stage.cpantesters.org
The authenticity of host 'stage.cpantesters.org (2607:f740:f::914)' can't
be established.
ECDSA key fingerprint is SHA256:AcGEg+DDHplQT8Cc02CYy8Y4p/C4I5ARoEhrA5ZvrOQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'stage.cpantesters.org,2607:f740:f::914' (ECDSA)
to the list of known hosts.
doug@local:~$ ssh stage.cpantesters.org
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:AcGEg+DDHplQT8Cc02CYy8Y4p/C4I5ARoEhrA5ZvrOQ.
Please contact your system administrator.
Add correct host key in /Users/doug/.ssh/known_hosts to get rid of this
message.
Offending ECDSA key in /Users/doug/.ssh/known_hosts:40
ECDSA host key for stage.cpantesters.org has changed and you have requested
strict checking.
Host key verification failed.
doug@local:~$ ssh-keygen -R stage.cpantesters.org# Host stage.cpantesters.org found: line 40
/Users/doug/.ssh/known_hosts updated.
Original contents retained as /Users/doug/.ssh/known_hosts.old
doug@local:~$ ssh stage.cpantesters.org
The authenticity of host 'stage.cpantesters.org (2607:f740:f::914)' can't
be established.
ECDSA key fingerprint is SHA256:AcGEg+DDHplQT8Cc02CYy8Y4p/C4I5ARoEhrA5ZvrOQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'stage.cpantesters.org,2607:f740:f::914' (ECDSA)
to the list of known hosts.
doug@stage.cpantesters.org's password:
doug@local:~$ ssh stage.cpantesters.org
The authenticity of host 'stage.cpantesters.org (2607:f740:f::914)' can't
be established.
ECDSA key fingerprint is SHA256:AcGEg+DDHplQT8Cc02CYy8Y4p/C4I5ARoEhrA5ZvrOQ.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'stage.cpantesters.org,2607:f740:f::914' (ECDSA)
to the list of known hosts.
doug@stage.cpantesters.org's password:
Permission denied, please try again.
doug@stage.cpantesters.org's password:
ssh stage.cpantesters.org
-l dbell
ssh dbell@stage.cpantesters.org
doug@local:~$ ssh dbell@stage.cpantesters.orgdbell@stage.cpantesters.org's password: Linux stage.cpantesters.org 4.9.0-3-amd64 #1 SMP
Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64
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.dbell@stage:~$
Host stage.cpantesters.org
User dbell
Host ct-stage
Hostname stage.cpantesters.org
Passwords
Identification
Authentication
Password
USB Device
SSH Keys
Asymmetric Cryptography
Key Pair
Public Key
Private Key
Encryption
Message for Alice
+ Public Key
= Encrypted message
Decryption
Encrypted Message
+ Private Key
= Message
Trust
Secure Communication
Key Algorithms
RSA
DSA
ECDSA
Generate a Key
ssh-keygen
doug@local:~$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/doug/.ssh/id_ed25519):
doug@local:~$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/doug/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
doug@local:~$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/doug/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
doug@local:~$ ssh-keygen -t ed25519
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/doug/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/doug/.ssh/id_ed25519.
Your public key has been saved in /Users/doug/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256:EfNX6BfSBrTgWdTzMC0BB7kLcgtjEGE0hcd0FVLOax0 doug@gwen.local
The key's randomart image is:
+--[ED25519 256]--+
| .*B= +=@X+o |
| .o.o* B++X .|
| o. +.=+EB |
| =.o.oo...|
| .S= ooo. |
| ... |
| |
| |
| |
+----[SHA256]-----+
doug@local:~$ ssh-copy-id stage.cpantesters.org/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/doug/.ssh/id_ed25519.pub"
/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
dbell@stage.cpantesters.org's password:
doug@local:~$ ssh-copy-id stage.cpantesters.org
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/Users/doug/.ssh/id_ed25519.pub"
/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
dbell@stage.cpantesters.org's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'stage.cpantesters.org'"
and check to make sure that only the key(s) you wanted were added.
doug@local:~$ ssh stage.cpantesters.orgEnter passphrase for key '/Users/doug/.ssh/id_ed25519':Linux stage.cpantesters.org 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64
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.
doug@local:~$ ssh-addEnter passphrase for /Users/doug/.ssh/id_ed25519:Identity added: /Users/doug/.ssh/id_ed25519 (doug@gwen.local)
doug@local:~$ ssh stage.cpantesters.orgLinux stage.cpantesters.org 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2+deb9u2 (2017-06-26) x86_64
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.
Start SSH Agent at Boot
Automatically Add Keys
AddKeysToAgent yes
Use MacOS Keychain
UseKeychain yes
ssh-add -K
Work on code
doug@stage:~$ git clone git@github.com:cpan-testers/cpantesters-web.git
Cloning into 'cpantesters-web'...
The authenticity of host 'github.com (192.30.253.112)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.112' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Agent Forwarding
Host stage.cpantesters.org
User dbell
ForwardAgent yes
Host ct-stage
Hostname stage.cpantesters.org