Connect to a Server - ARC-Lab-UF/docs GitHub Wiki

Author: Benjamin Wheeler (@benjamin051000)

UFAD servers use your UF GatorLink username and password for authentication. This guide will show you how to connect via SSH to a remote UF-network linux server using GatorLink Authentication, and SSH keys.

Note: For any given command, <username> should be replaced with the GatorLink username. <server> should be replaced with a server hostname. For example, if you are referencing the command ssh <username>@<server>, your GatorLink username is albert, and the server you wished to use is my-server.com, you would use the following command:

ssh [email protected]

Table of Contents


Prerequisites

Your local computer must either be on the UF Wireless network (eduroam) or connected to the UF VPN service.

Connect to the Server

Click on the operating system to see details on connecting to a remote server.

Connecting From Windows

While recent versions of Microsoft Windows 10 come with OpenSSH installed, they do not include an X server, which is necessary for running GUI applications over SSH. There are several third-party applications discussed below that allow this:

X2Go

If X2Go is available on your server, it is a good option for X11 forwarding.

  • Download X2Go to your local machine and launch it.
  • Choose Session > New session ...
  • In Session name:, enter a nickname for this session.
  • In the Server pane, enter the following credentials:
    • Host: The hostname of your server (e.g., ece-b312-sharp14.hcs.ufl.edu)
    • Login: Your GatorLink username
    • If you plan to login via private key, enter the path to your private key under Use RSA/DSA key for ssh connection.
  • Finally, in the Session type pane, choose "Single application" and in Command choose "Terminal".

x2go session preferences example

Now, click on the configuration you just made. You may be prompted to enter your GatorLink password. A terminal should open and you should be able to run GUI applications on the server.


Cygwin

Cygwin is a terminal emulator that offers an X-server for X11 forwarding.

Install Cygwin

  • Download Cygwin to your local machine and launch the setup program
  • Use all default settings until you reach the "Select Packages" page
  • Change view to "Category" and use the search box to find packages. Click on the word "Skip" in the "New" column to change it to the version number you'd like to install. At minimum, install the following packages:
    • openssh in the "Net" category
    • xinit in the "X11" category
    • xorg-server in the "X11" category
  • Click "Next" in the bottom right-hand corner, confirm the packages, and finish the install

Note: You can launch the setup program in the future to install new packages and update/remove existing packages.

Setting up the Cygwin X11 server

  • To have the X11 server start automatically when you log in (recommended), you first need to navigate to the "Startup" folder located at C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • Right click the background of the folder and select New->Shortcut. For the location of the item, copy and paste the following and hit next:
    C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; exec /usr/bin/startxwin -- -nowgl -listen tcp"
  • Name the shortcut XwinServer

Note: This will start the X11 server automatically next time you log in. Until that time, it will not be running. You can either launch the server automatically or just restart your computer.

  • In Windows, navigate to your cygwin .bashrc file located at C:\cygwin64\home\<username>\.bashrc. Using a text editor, add the following line to the end of the file:
export DISPLAY=:0.0

Using Cygwin

Launch the Cygwin Terminal application and run

ssh -Y <username>@<server>.hcs.ufl.edu

Enter your password when the prompt appears. You are now connected and ready to work!


PuTTY (requires Cygwin for X11) PuTTY is an SSH and telnet client, capable of using a Cygwin X server to connect to a remote host with X11 GUI application forwarding.
  • Download PuTTY to your local machine and start the program
  • Use <server>.hcs.ufl.edu for your "Host Name"
  • On the left, expand the "SSH" tab and select "X11"
  • Check the box next to "Enable X11 forwarding"
  • For the box that is labeled "X authority file for local display", navigate to your Cygwin Xauthority file. It should be located in a path similar to C:\cygwin64\home\<username>\.Xauthority
  • On the left, click on the "Session" tab and start the session by clicking "Open"
  • At the login prompt, enter your username (this should be the same as your GatorLink username)
  • Enter your password when prompted. You are now connected and ready to work!

Note: You can save your session by entering a name in the "Saved Sessions" box and clicking the "Save" button to the right.


MobaXterm (used for Intel FPGA Devcloud)

MobaXterm is an enhanced terminal for Windows with an X11 server, tabbed SSH client, and more.

Intel FPGA Devcloud recommends using MobaXterm for their services. An official set of instructions on setting that up can be found here:

https://github.com/intel/FPGA-Devcloud/tree/master/main/Devcloud_Access_Instructions#devcloud-access-instructions

Note: Intel mentions in those instructions: "Note that the X11 server with Mobaxterm runs slow, so we don't recommend its use. The X2Go section shows how to gain GUI access."

Connecting with Linux/Unix/MacOS

Open a terminal and run

ssh <username>@<server>.hcs.ufl.edu

Enter your password when the prompt appears. You are now connected and ready to work!

Transferring Data

A common important task is to transfer files between your host machine and the server. There are several GUI and CLI tools to accomplish this.

GUI Choices

If you would like to use a Graphical User Interface, we recommend:

  • FileZilla for Windows or MacOS X
  • WinSCP for Windows.
    • If you wish to open files with WinSCP, you can choose to open files in something other than the default editor by clicking the option tab, preferences, editors, Add. Then either specify an external editor to use (for example notepad++) or use the associated application with your windows machine (like open csv using excel). Feel free to specify a file type and press ok. Make sure to double check the editor preference order.
  • Cyberduck for MacOS X

After you have chosen and downloaded a client, configure the client to connect to <server>.hcs.ufl.edu, specifying port number 22. Use your username and password (or possibly an SSH key) to log in.

Command line choices

  • SFTP
  • SCP

Editing your Files

Several methods exist for editing your files on the cluster.

Native Editors

Vim (vim)

The visual editor improved (vim) is the traditional Unix editor; however, it is not necessarily the most intuitive editor.

Emacs (emacs)

Emacs is a much heavier duty editor, but again has the problem of having commands that are non-intuitive.

Nano (nano)

Nano is a lightweight text exitor with a simpler user interface than Vim or Emacs.

VSCode (code)

VSCode is code editor with development features typically found in an IDE. Code provides comprehensive editing and debugging support, an extensibility model, and lightweight integration with existing tools.

External Editors

You can also use your favorite file editor on your local machine, and then transfer the files to the cluster afterward. A caveat to this is that files created on Windows machines usually contain unprintable characters, which may be misinterpreted by Linux command interpreters (shells). If this happens, there is a utility called dos2unix that you can use to convert the text file from DOS/Windows formatting to Linux formatting.

VSCode with Remote Development Extensions

See this page for a tutorial on how to connect your local VSCode instance to a remote server.

Using Installed Software

Access to installed software is provided through Environment Modules.

The following command can be used to browse the full list of available modules:

module avail

To load a module, use the following command:

module load <module_name>

Now, the loaded module will effecively be added to your PATH so you can run the commands you loaded.

⚠️ **GitHub.com Fallback** ⚠️