Home CPSC 225

Using SSH on OSX or Linux

  1. Open A Terminal

    This will be slightly different depending on if you are using OSX or Linux, and which version of Linux which you are using. In OSX, open your Applications folder, and double-click the "Utilities" entry. In that folder, find the "Terminal" entry and double-click it. In Linux, the terminal is often in the application menu under 'Accessories' or 'System'. Many Linux desktops also use the shortcut 'Control-Alt-T' for opening a terminal window.


    A terminal window.

  2. Use the SSH Command

    At the terminal type:

    ssh USERNAME@cpsc.umw.edu
    Replacing USERNAME with your UMW netid. Then hit the enter key.

    Enter the password which was sent to you in the CPSC 225 welcome email. Your password will not be shown, not even as little dots or stars. Just type it in and hit enter. If you cannot find your password, please email ifinlay@umw.edu.

    You should now see something like the following:

    Congratulations, you are logged into cpsc.umw.edu! If you have any trouble with these instructions, please email me.

  3. Change your Password

    Once you are logged in, enter the passwd command. This will ask you to enter your existing password, then choose a new one (and repeat it to confirm). Just like when logging in, it will not show your password. Choose a secure new password for your account.

    ifinlay@cpsc:~$ passwd
    Changing password for ifinlay.
    Current password: 
    New password: 
    Retype new password: 
    passwd: password updated successfully
    


 

Optional: Key-Based Authentication

To set up authentication using SSH keys instead of a password, follow these instructions:

  1. Generate a Key Pair

    On your local machine, open a terminal and enter the command:

    ssh-keygen

    Then hit enter three times in response to the questions. This generates a public/private key pair for your computer.

  2. Put the Public Key on the Server

    On your local machine, run the following two commands:

    ssh USERNAME@cpsc.umw.edu "mkdir -p ~/.ssh"
    cat ~/.ssh/id_rsa.pub | ssh USERNAME@cpsc.umw.edu "cat >> ~/.ssh/authorized_keys"

    Replace USERNAME with your user name. Enter your password for the CPSC server when prompted. This adds the public key to the list of authorized keys.

  3. Log in to the Server

    Login using the command:

    ssh USERNAME@cpsc.umw.edu

    It should not need you to enter your password now!

Copyright © 2022 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.