Remote Access - Linux

Occasionally it will be beneficial to have remote access to the Linux filesystem that is used in the Computer Science labs. Access is automatically available for all students enrolled in a Computer Science class; no extra permissions are needed. Instructions for accessing your /home/<username>/ directory can be found below.

Access to your home directory is accomplished through SSH. Most openssh-compatible SSH programs/SFTP programs will be compatible with our systems, but these directions will cover only common supported ones. In these directions, we will cover generating an SSH keypair, uploading it to the CS FreeIPA system, and using it within a common client to connect to our server. This process is required for all off-campus connections into our server infrastructure.


Select a button above for directions.

Windows

For access both on-campus and off-campus for Windows, we will use the Bitvise SSH client. After installing, we'll generate an SSH keypair and upload the public key to the FreeIPA servers.

  1. Download Bitvise SSH Client (Tunnelier) and install it.
  2. Launch Bitvise SSH client.

  3. In this next section, we will generate SSH keys for use. This only needs to be done once.

  4. Select Client key manager.
    1. Click the Generate New button.
    2. In the "Generate New Keypair" dialog box, fill in:
      • Algorithm: RSA
      • Size: 4096 (Note: this is the strength of your SSH key, 3072 and above is fine, but 4096 is recommended.)
      • For passphrase, this passphrase is specifically for your SSH private key. This is NOT your Computer Science password, but a password to decrypt your SSH private key.

      • Passphrase: <a password for your SSH private key>
      • Confirm Passphrase: <your password for your SSH private key again>
      • Click the Generate button to continue.
    3. Click the Export button to start the process to export your public key.
    4. In the "Export Public or Private Key" dialog box, click Export Public Key and OpenSSH format.
    5. Click the Export button to continue.
    6. Select a location to save your public key. Name it whatever you like, but I'd recommend <username>.pub. Remember where you exported this public key.
    7. Leaving Bitvise running, we need to open our key in a text editor. From your Start Menu, open Notepad.
    8. Within Notepad, open your public key that you saved earlier.
    9. Copy the entire contents of the file, starting with "ssh-rsa" all the way to the end of the file.
    10. For this next step, we will be adding our public key as an authorized key within the FreeIPA Linux user management system. If you would like to watch a video of this step, it is available here.

    11. Log into FreeIPA by visiting https://freeipa1.cs.calvin.edu.
    12. Under the SSH public keys section, click the Add button.
    13. Paste the full contents of your public key into the "Set SSH key" dialog box, and click Set.
    14. At the top of the FreeIPA page, click the Save button.
    15. Close out your web browser and Notepad, and return to Bitvise.
    16. Close out the "Bitvise Client Key Management" dialog box, and return to the main Bitvise window.

  5. In this section, we'll make our connection to the cs-ssh server.

  6. In the main menu, fill in the following values:
    • Host: cs-ssh.cs.calvin.edu
    • Port: 22
    • Username: <your username>
    • Initial method: publickey
    • Client key: Global 1 (Note: whatever the index was of the key you just generated.)
    • Passphrase: <your SSH private key passphrase>
  7. Click Login.
  8. If prompted, accept and save any host SSH keys.

At this point, you should be logged into cs-ssh under your username. You may click the "New SFTP window" to get a graphical UI for transferring files.


Note: if you are upgrading from an older version of BitVise, you may need to enable additional SSH key exchange methods.

  1. Open BitVise
  2. Select the SSH tab along the top of the screen.
  3. Click the "Key Exchange" link.
  4. Make sure the following are selected:
    • Curve25519
    • diffie-hellman-group-exchange-sha256
    • ECDH/nistp384
Mac OS X

For Mac operating systems, we will be utilizing native OpenSSH tools. These tools are pre-installed in all modern Mac OS X installations.

In this section, we will generate our SSH private and public keys.

  1. Open a Terminal window. (Finder - Applications - Utilities - Terminal).
  2. Run the command: ssh-keygen -b 4096 -t rsa
  3. By accepting the default file location, your public and private keys are saved to /Users/<username>/.ssh/. Your private key is named "id_rsa", while your public key is named "id_rsa.pub".

  4. View the contents of your public key by running the command: cat .ssh/id_rsa.pub
  5. Select and copy the complete contents of your public key, starting with "ssh-rsa" all the way to the end of the file.

For this next step, we will be adding our public key as an authorized key within the FreeIPA Linux user management system. If you would like to watch a video of this step, it is available here.

  1. Log into FreeIPA by visiting https://freeipa1.cs.calvin.edu.
  2. Under the SSH public keys section, click the Add button.
  3. Paste the full contents of your public key into the "Set SSH key" dialog box, and click Set.
  4. At the top of the FreeIPA page, click the Save button.
  5. Close your web browser.

At this point, you can continue using common command line tools from a terminal. Launch Terminal and follow the directions for Command Line connections.

Command Line Operations

Using OpenSSH tools, we can get a remote console or copy files using the scp program. This section assumes that you have generated your SSH keys, and uploaded them into FreeIPA. See the specific operating system instructions for more details.

Remote Console

ssh <username>@cs-ssh.cs.calvin.edu
Example: ssh jcalvin@cs-ssh.cs.calvin.edu

Remote File Transfer

scp <localfile> <username>@cs-ssh.cs.calvin.edu:/home/<username>/<remotefilename>
Example: scp project1-results.txt jcalvin@cs-ssh.cs.calvin.edu:/home/jcalvin/project1/project1-results.txt. Note: You can just supply a folder path, and the file name will be assumed.

Remote File Transfer - Recursive Directory

scp -r <somefolder> <username>@cs-ssh.cs.calvin.edu:/home/<username>/<remotefolder>/
Example: scp -r proj1 jcalvin@cs-ssh.cs.calvin.edu:/home/jcalvin/

Linux

For Linux operating systems, we will be utilizing native OpenSSH tools.

In this section, we will generate our SSH private and public keys.

  1. Open a Terminal window.
  2. Run the command: ssh-keygen -b 4096 -t rsa
  3. By accepting the default file location, your public and private keys are saved to /home/<username>/.ssh/. Your private key is named "id_rsa", while your public key is named "id_rsa.pub".

  4. View the contents of your public key by running the command: cat .ssh/id_rsa.pub
  5. Select and copy the complete contents of your public key, starting with "ssh-rsa" all the way to the end of the file.

For this next step, we will be adding our public key as an authorized key within the FreeIPA Linux user management system. If you would like to watch a video of this step, it is available here.

  1. Log into FreeIPA by visiting https://freeipa1.cs.calvin.edu.
  2. Under the SSH public keys section, click the Add button.
  3. Paste the full contents of your public key into the "Set SSH key" dialog box, and click Set.
  4. At the top of the FreeIPA page, click the Save button.
  5. Close your web browser.

At this point, you can continue using common command line tools from a terminal. Launch Terminal and follow the directions for Command Line connections.

On-campus

If you are on the Calvin campus network (whether via WiFi or Ethernet), you are allowed to connect into the CS servers without using an SSH keypair, by just using your Computer Science Linux password. For ease of use, all operating systems on-campus can use the FileZilla client. NOTE: If you are already set up using your SSH private and public keys, use that method instead.

  1. Download FileZilla and install it. (Note: pick the 32-bit or 64-bit as appropriate for your operating system; it won't make any difference to these directions.)
  2. Launch FileZilla.
  3. Goto File -> Site Manager
  4. Click the New Site button.
    • Name your site: cs-ssh
    • Host: cs-ssh.cs.calvin.edu
    • Port: 22
    • Protocol: SFTP - SSH File Transfer Protocol
    • Logon Type: Ask for password
    • User: <your username>
    Click OK.
  5. Click the Connect button down-arrow, and select "cs-ssh".
  6. Type your password when prompted.

Once connected, you can drag-and-drop files into your remote home directory.