Remote Access To CS Machines

This document outlines the steps you should take to connect to CS machines from off-campus.

  1. Set up Pulse Secure to access the campus VPN.

  2. Set up ssh for password-less access to a CS machine.

  3. Set up x2go for GUI access to a CS machine.

This document uses the term workstation to refer to the computer to which your keyboard and mouse are attached to. It uses REMOTE to refer to the name (like remote.cs.binghamton.edu) or IP address (like 128.226.28.100) of the remote machine and LOGIN_ID to refer to your login ID on REMOTE.

Set Up Pulse Secure

Follow the instructions provided by ITS to set up the Ivanti Pulse Secure client on your workstation. Once set up, use it to connect to the campus VPN.

Please note that the client times out after around 4 hours and you will be disconnected abruptly. To avoid losing work, it is a good idea to ensure that you are using a GUI session on the remote machine (as outlined later in this document) so that you can resume where you left off after reconnecting the VPN client.

Command-line SSH Access to the Remote Machine

  1. Connect to the campus VPN using the Ivanti Pulse Secure client.

  2. Fire up a terminal on your workstation.

    • If your workstation runs Windows, then as a CS student, you really should be using Windows SubSystem for Linux and you should start wsl within a PowerShell terminal. If you do not have wsl installed, please install it using these instructions.

    • If your workstation runs OS/X, then use the OS/X Terminal application.

    • If your workstation runs Linux, then use any terminal application available for your distribution.

  3. Test whether you can login to the remote CS machine.

    $ ssh LOGIN_ID@REMOTE
    LOGIN_ID@REMOTE's password:

    You should get logged in if you correctly provide your password for REMOTE at the prompt.

    [You should have been provided with LOGIN_ID and password for REMOTE. If that is not the case, please contact the CS SysAdmin for remote.cs.binghamton.edu or your instructor for a course-specific VM.]

  4. If you are still using the password provided originally by the sysadmin or your instructor, it is imperative that you change it at once to one of your choosing:

        $ passwd
        Current Kerberos password: 
        New password: 
        Retype new password: 
    

    Note that the passwords are not echoed above.

  5. Logout from the remote machine by typing a Control-D character.

  6. Generate a public/private key-pair for ssh if you do not already have one on your workstation.

    1. Check whether you already have one. In the terminal running on your workstation:

              $ ls ~/.ssh/id_rsa*
      

      If the above command shows the two files id_rsa.pub and id_rsa, then you already have a public/private key-pair and you should skip the next step.

    2. Generate a new public/private key-pair:

      	$ ssh-keygen
      

      You may choose to accept all the defaults by simply typing <ENTER> at the prompts.

  7. Copy your public key to the remote computer:

    $ ssh-copy-id LOGIN_ID@REMOTE

  8. Test whether you can login to REMOTE without needing to specify a password:

    $ ssh LOGIN_ID@REMOTE

    You should get logged in. Review the previous steps if you are still prompted for a password.

GUI Remote Access

After you have successfully completed the steps in the previous section, you should have command-line access to the remote machine. This will not be sufficient to run GUI applications like web browsers or IDE's on the remote machine. In order to run such applications, you will need to run a GUI client like x2go or vnc on your workstation.

Running x2go

  1. Install a X2Go client for the workstation you are using to access your VM if one is not already installed (note that a x2goclient command is available on remote.cs).

  2. Start the x2goclient.

  3. Create a session for connecting to your VM by clicking Session -> New session. Fill in the following fields:

    Session name

    LOGIN_ID@REMOTE

    Host

    REMOTE. Make sure you fill in the full name or IP address of the remote machine.

    Login

    Your login id LOGIN_ID on REMOTE.

    Auto Login

    Select Try auto login (via SSH Agent or default SSH key) (this assumes that you have correctly set up password-less login from your workstation to REMOTE).

    Session type

    XFCE or any type like MATE, GNOME appropriate to the window managers available on REMOTE.

  4. Once you connected your workstation to the campus VPN using the Ivanti client, you should now be able to use the above session to display a GUI desktop for REMOTE on your workstation. You should not require a password if you have set up the ssh keys correctly.

The following is a screenshot of my x2go configuration for accessing remote.cs from within the campus network (or VPN):

With the above setup, I do not need to type in a password when connecting to remote.cs.

When disconnecting from x2go, use the Suspend control (the widget which looks like a pause control, with two lines) on the blue x2go window. This will ensure that you can pick up where you left off when you reconnect to your VM.

Other GUI Access Methods

X2go is strongly recommended. However if you cannot get it to work, then other possibilities include:

VNC

You will need to ensure that REMOTE is running a vnc server. Then you will need to use a vnc client on your workstation to connect to the server. See Tight VNC for further documentation.

Xming Server for Windows

Instead of running a full remote session, you can run a X11 server on your Windows workstation. xming appears to be a popular X11 server running under Window. Apparently, xlaunch is a wizard for starting xming sessions. Since I do not use Windows, I have not tried this and YMMV.

Debugging Connectivity Issues

If you cannot connect, please try the following:

  1. Verify that your workstation's internet connection is working by accessing some web site not related to the university.

  2. Connect your workstation to the campus VPN.

  3. Use ssh to connect to remote.cs. If that fails, go to the CS SysAdmin page for assistance.

  4. If you are having trouble connecting to a VM, first ssh from your workstation to remote.cs and then ssh from remote.cs to your VM using its IP address. If this succeeds, then there is a problem with x2go.

  5. If the problem appears to be x2go, try shutting down your x2goserver using the power button on your x2goclient (If connecting to a VM, try restarting your VM).

    Some students using OS/X workstations have found that:

    1. Rebooting your mac may help.

    2. More drastic: Reinstalling x2go and xquartz solves x2go problems.

    3. An even more drastic workaround: If you have xquartz installed, but x2go is not installed or not working, you can display GUI applications running on REMOTE on your mac by using the -Y option when connecting to remote.cs using your OS/X terminal.

If all else fails, ask for help by sending your instructor an email. The email should describe your workstation's environment and detail the responses to each of the above steps.