SSH

Provides a secure replacement for rlogin, rcp, and telnet

Why use ssh?

A Little Background

What is Encryption?

Two Key Algorithm Types
  • Symmetric Encryption
  • Asymmetric Encryption
  • Symmetric Asymmetric What are Hashes?

    Authentication process

  • User logs in and types in their password
  • A hash is computed from user's password input
  • This hash is compared to the hash stored on your system (in the /etc/shadow file)

  • How SSH authenticates
    SSH can use serveral different ways to authenticate users

    1. Using ~.rhosts, ~.shosts, /etc/hosts.equiv, or /etc/shosts.equiv  2. Using Host-Based authentication with RSA
    3. Authenticating the user with RSA Authentication (most secure) 4. by authenticating the user with their normal login password
    SSH Components Examples: (~/.ssh/known_hosts must be populated with the remote host)
    $ ssh -l pattyo mammoth
    $ scp pattyo@mammoth:/home/pattyo/testfile .
    $ ssh -v remote-server
    $ sftp 192.168.1.20
    Connecting to 192.168.1.20...
    pattyo@192.168.1.20's password:
    sftp>

    The authentication policy is set in the /etc/ssh/sshd_config file on the server
    Here are some key entries:
    RhostsAuthentication no
    RhostsRSAAuthentication no
    RSAAuthentication yes
    PasswordAuthentication yes
    IgnoreRhosts yes
    Generating an RSA key for a user using SSH version 2
    The -t option specifies the type of key to create.
    $ ls -lt | head
    You will need to copy the id_rsa.pub file to the  authorized_keys2  file on each machine you wish to connect via RSA using SSH version 2. Now try connecting to the host on which you just catted your rsa public key
    $ ssh ponto
    Last login: Tue Apr 29 11:55:53 2003 from ponto.example.com

    Problems??
    ls -ld .ssh
    chmod 400 .ssh
    chmod 400 .ssh/*

    $ ssh -v remote-host
    The two versions of SSH
  • SSH1
  • work finished by end of 1998
  • SSH2
  • Configuration files on the client and server side.

    This picture is from "SSH, The Secure Shell, The Definitive Guide", by Daniel J Barrett and Richard Silverman.














    Man in the Middle Attack

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
    @    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 the RSA host key has just been changed.

    Man in the middle diagram

    www.vandyke.com/solutions/ssh_overview/ssh_overview_threats.html