CS Student Server Usage

Account Info

Your instructor will tell you your username; it is generally the same as your my.chemeketa username (asmith4@my.chemeketa.edu would be asmith4). Anywhere below you see USERNAME or PASSWORD substitute your actual credentials.

Logging Into the Server

You will use ssh to log in and work on the remote server.

To log in, open a command prompt/terminal window and do:

ssh USERNAME@cs-student.chemeketa.edu

You will be prompted for your password. If this is your first login, see the special instructions below.

If you try to log in unsuccessfully ~5 times within 10 minutes, you will be banned for 10 minutes. (This is a security measure to prevent brute force attacks.) During this time you will be unable to connect to the server - if you try to connect to the server, the connection will just time out (you won't see any response).

While banned, you can check to see that the server is still there by doing: ping cs-student.chemeketa.edu. If you get replies, you know the server is there, it is just not letting you connect with ssh.

You will start your session in your home directory /home/USERNAME/. ~ is another name for your home directory. Any work you do should be saved within this folder. Any time you want to reset your location to it, you can do:

cd ~

First Log In / Password Reset

The first time you log in, you will be use the password supplied to you by your instructor. As soon as you log in the first time with it, you will be asked to change your password. To do this you will need to:

  • Enter your current password (again)
  • Enter your new password
  • Enter your new password (again)

At this point, your connection will be closed. You can then reconnect using your new password.

If you do not successfully complete the change process, you will need to try again, using your old password to log in.

If at any point you want to change your password, you can type this while logged into the server:

passwd

You will then go through the same steps (old password once, new one twice).

Logging Out

When you are done working on the server, you can type this to close the ssh connection:

exit

Avoiding using a password

Typing a password every time you want to sync your local files to the remote server might get tiresome. Below are instructions for generating an ssh public/private key pair you can use to identify yourself without a password.

Don't invest time into figuring out ssh keys until you are already successfully using the server (including uploading code and running it on the server).

Before setting up an ssh key, make sure you log into the server once using your password.

Key setup - Mac

A mac should work just like Linux, but you first have to make sure that you have the utility ssh-copy-id. Modern versions of Mac OSX should have it already installed. Open a terminal and type ssh-copy-id. If you are given a list of usage options, continue to Key setup - Linux and follow those instructions.

If you get an error about ssh-copy-id not being found, here is how to install it:

Install homebrew by following the instructions on their site.

Then open a terminal and type:

brew install ssh-copy-id

Then continue using the Linux instructions.

Key setup - Linux

You can follow these instructions to set up an ssh key that can be used to identify yourself without a password.

You should only need to do steps 1-3. In step 2, make sure you use USERNAME@cs-student.chemeketa.edu instead of typing remote-host.

Now skip down to Using your key

Key setup - PC

Follow these Windows instructions to set up an ssh key. If you have a fairly recent version of windows, the OpenSSH method should work for you.

Then follow the instructions for insalling rsync.

You then need to upload your ssh public key to the server using rsync. Open up a Git bash command prompt. Then do the following:

rsync -i /c/Users/YOURNAME/.ssh/id_rsa.pub USERNAME@cs-student.chemeketa.edu:~/.ssh/authorized_keys

Make sure to change YOURNAME to your windows username. The file /c/Users/YOURNAME/.ssh/id_rsa.pub should be the public key you generated.

Make sure to change USERNAME to your username on the cs-student server.

Using your key

When you login with ssh, you should no longer need to type a password.

To use your key with rsync, you will add -i for identity and then pass your private key as part of the rsync command:

rsync -i /PATHTOKEY/KEY -a FOLDERNAME USERNAME@cs-student.chemeketa.edu:~/

If you are on a Mac or Linux machine, that will probably look like:

rsync -i /home/YOURNAME/.ssh/id_rsa -a FOLDERNAME USERNAME@cs-student.chemeketa.edu:~/

If you are on a PC using Git bash, that will look like:

rsync -i /c/Users/YOURNAME/.ssh/id_rsa -a FOLDERNAME USERNAME@cs-student.chemeketa.edu:~/