CS211: (Appendix) Connecting to Remote Servers
Table of Contents
Introduction
Many students taking this class will likely not be using laptops/devices running a Linux distribution. If this is the case with you, you will likely need to connect to the remote systems so you can test out your code in a Linux environment. It may seem a bit scary at first, but it really isn't all that bad.
Getting on the Network
In my experience, I can connect to the remote servers from my laptop as long as I'm on the eduroam network. Some students do not find this to be the case. However, you can be certain that if you live off campus you will not be able to connect to the remote servers without using the school sanctioned VPN. You can find instructions for how to download and install the Cisco Secure Client VPN here.
Using ssh
If you want to edit your files remotely through the terminal you'll need to fire up the Secure SHell, or ssh. All you need to do is follow the syntax shown in the man page:
ssh [user@]hostname[:port]
ssh is the name of the executable stored somewhere on your $PATH. user is the username associated with your account (likely your b-mail username). hostname is the name of the remote server you're connecting to (for non-CS engineering students that should be bingview.binghamton.edu. :port you can ignore.
If I want to connect to my remote account I would do:
I will then be prompted to enter my password. If everything has gone smoothly, I should be greeted with the following:
ssh [email protected] [email protected]'s password: Last login: Fri Dec 5 20:27:52 2025 from 128.226.206.214 ************************************************** *\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ *\\************************************************** *\\* +-----------------------------+ *\ * *\\* / Binghamton University /| *\\* *\\* +-----------------------------+ | *\\* *\\* | Be considerate. When your | | *\\* *\\* | code error takes the server |-+ *\\* *\\* *******| off line, No one codes. |/******\\* *\\*\\\\\\\\+-----------------------------+\\\\\\\\\* \\*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\* ************************************************** #################################################### # NOTE: # # If you are taking a database class and # # need to connect to the ACAD111 database... # # # # The correct syntax when using SQLPlus on HarveyV # # to connect to the Oracle ACAD111 database is : # # sqlplus jraskin3@acad111 # #################################################### [jraskin3@harveyv ~]$
Setting up SSH Key
Some students find it to be a pain to constantly type in their password anytime they want to connect. The solution to this is establishing an ssh key.
You can generate an ssh public/private key by typing ssh-keygen and hitting enter to follow the default configurations. It will look something like this:
josephraskind@stargazer:~/Documents/Teaching/CS211$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/josephraskind/.ssh/id_rsa): ... Your identification has been saved in ... Your public key has been saved in ... ...
You can then use the command ssh-copy-id as if it were the original ssh command:
josephraskind@stargazer:~/Documents/Teaching/CS211$ ssh-copy-id [email protected] /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "[REDACTED]" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys [email protected]'s password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '[email protected]'" and check to make sure that only the key(s) you wanted were added.
You should now be able to connect without typing in your password.
You can double-check everything went to plan by printing out ~/.ssh/authorized_keys while in the remote server:
[jraskin3@harveyv ~]$ cat ~/.ssh/authorized_keys ssh-rsa [REDACTED]
You may delete that file at any point to reset the SSH keys.
Possible Errors
If I'm not connected to the VPN I will get the following error:
ssh: Could not resolve hostname bingview.binghamton.edu: Name or service not known
This is because the URL is only exposed to users connect to the VPN or on the local network.
If I type my username incorrectly, ssh will not let me know:
josephraskind@stargazer:/tmp/$ ssh [email protected] [email protected]'s password: Permission denied, please try again.
In the above, I forgot the "s" in my username, but ssh let me try to login anyway and only mentioned the password was wrong.
If you are having trouble with logging in always double check the username, hostname, and password. Students will often ask for help thinking something is wrong with their computer only to find they left out a letter somewhere along the way.