[CHUUG]

Stupid SSH Tricks

Basic Setup



  • Create a key:

    1. cd
    2. ssh-keygen
    3. Accept default location for your keys (~/.ssh/) by pressing <return>
    4. Choose an empty passphrase; just hit <return> when asked for it (see next slide if you want a non-blank passphrase).
    5. cd ~/.ssh/
    6. cp identity.pub authorized_keys
    7. chmod 0600 authorized_keys

    This gives password-less access to any local machines that share your login area (via NFS, presumably). This can be good and bad.

  • To extend this to remote systems:

    1. slogin to the remote site; it'll want your password.
    2. Go through the steps above on the remote system (generate a key there).
    3. Copy your identity.pub file from the local host, and append it to the authorized_keys file you just created on the remote host. This allows you a password-less login from local to remote.
    4. If you want the same from remote to local, copy the newly generated identity.pub from the remote host and append it to the authorized_keys file on the local host.
    5. Repeat for each other remote site as you want (think if you need things two-way or not, and how well secured the remote site may be; do you trust its sysadmin?).
 
 


Stupid SSH Tricks
Pat Murphy