Site Tools


students:sshaccess

This is an old revision of the document!


SoCS SSH Access

The Basics

SSH Allows you to remotely connect to SoCS Linux servers. To connect from a Linux or Mac OS/X base computer, use the command “ssh <username>@<hostname>socs.uoguelph.ca”, where <username> is your SoCS username and <hostname> is the name of the server you wish to connect to (i.e. linux, portkey).

Off-Campus Access

The CCS Firewall blocks ssh access to most hosts from off campus. To connect from off campus there are two options:

  • Connect to portkey.socs.uoguelph.ca and from there connect to your desired host
  • Set up the CCS VPN. Instructions can be found at vpn.uoguelph.ca

SSH Keys

SSH Keys allow you to use a key to connect instead of using your password. This has the benefit of being both more secure, and more convenient to use.

To set up public key private key access to linux:

Part A On OS/X or Linux
  1. Have a passphrase (password) handy that you can remember.
  2. Open a terminal window
  3. Type ssh-keygen -t rsa -C yourusername@linux.socs.uoguelph.ca at the command prompt
    1. Press return to accept the default file locations for storing keys
    2. Enter your passphrase when prompted (make sure you can remember it)
    3. Enter the SAME passphrase again
  4. In the same terminal window, change to your .ssh directory. A foolproof way to do this is to first type cd followed by return, then type cd .ssh
  5. Type “more id_rsa.pub” without the quotes
  6. Copy the long string of text that begins with ssh-rsa and ends with yourusername@linux.socs.uoguelph.ca. It will wrap across several lines.
  7. Keep that text in the clipboard for the next step and go to Part B For all Platforms
Part A Windows
  1. Have a passphrase(password) handy that you can remember
  2. Start the PuTTYgen utility, by double-clicking on its .exe file
  3. For Type of key to generate, select SSH-2 RSA
  4. In the Number of bits in a generated key field, specify either 2048
  5. Click the Generate button
  6. Move your mouse pointer around in the blank area of the Key section, below the progress bar until the progress bar is full
  7. A private/ public key pair has now been generated
  8. In the Key comment field, enter any comment you'd like, to help you identify this key pair, later (e.g. your e-mail address; home; office; etc.) – the key comment is particularly useful in the event you end up creating more than one key pair
  9. Type a passphrase in the Key passphrase field & re-type the same passphrase in the Confirm passphrase field
  10. Click the Save public key button & choose whatever filename you'd like (some users create a folder in their computer named my_keys)
  11. Click the Save private key button & choose whatever filename you'd like (you can save it in the same location as the public key, but it should be a location that only you can access and that you will NOT lose! If you lose your keys and have disabled username/password logins, you will no longer be able log in!)
  12. Right-click in the text field labeled Public key for pasting into OpenSSH authorized_keys file and choose Select All
  13. Right-click again in the same text field and choose Copy.
  14. Keep the text in your clipboard for the next step.
Part B For all platforms
  1. ssh to portkey.scos.uoguelph.ca using your SoCS login and password (use putty on windows if you don't have a different client. On OS/X and linux just use a terminal)
  2. Type “cd .ssh” at the command prompt (without the quotes).
  3. If you get an error “.ssh No such file or directory”, type “mkdir .ssh”, then type “cd .ssh”, otherwise ignore this step“.
  4. Use your favourite command line editor (vim, nano, emacs or whichever) to edit the authorized_keys file
    • i.e. type 'nano authorized_keys' at the command line
    • Unless you've done this step once already, you will be creating this file. it MUST be called authorized_keys
  5. Paste in the long string of text that you copied to your clipboard in step A
  6. Save the file.
  7. Log out of Portkey.
Part C For all platforms
  1. Open putty or a terminal window
  2. ssh to portkey.socs.uoguelph.ca
  3. You SHOULD be prompted for the passphrase you used in Part A, and then you should connect to portkey.
  4. This login method works for secure FTP programs too, such as filezilla, which will allow you to ftp files directly to your linux account.

Once you have your ssh keys set up you will be able to use them to log in to any SoCS Linux server (i.e. portkey, linux). Remember, you can only log into portkey directly from off campus.

students/sshaccess.1494944244.txt.gz · Last modified: 2017/05/16 14:17 by kjohns23