Difference between revisions of "SSH/SFTP"

From radwiki
Jump to navigation Jump to search
m
Line 1: Line 1:
Shell access is arguably the most important feature of the GPU cluster, as it allows researchers to run their code, e.g. using the [[Anaconda|anaconda]] environment. In addition, remote desktop solutions typically depend on shell (SSH tunnel) access.  
+
Shell access is arguably the most important feature of the GPU cluster, as it allows researchers to run their code, e.g. using the [[Anaconda|anaconda]] environment or [[matlab]]. In addition, remote desktop solutions typically depend on shell (SSH tunnel) access.  
  
 
[https://en.wikipedia.org/wiki/Secure_Shell SSH] allows commandline access to the connected server.   
 
[https://en.wikipedia.org/wiki/Secure_Shell SSH] allows commandline access to the connected server.   

Revision as of 03:28, 29 May 2020

Shell access is arguably the most important feature of the GPU cluster, as it allows researchers to run their code, e.g. using the anaconda environment or matlab. In addition, remote desktop solutions typically depend on shell (SSH tunnel) access.

SSH allows commandline access to the connected server.

SFTP allows file transfers.

While file transfer using SFTP has practically no learning curve, commandline usage requires learning at least a few core commands. If you have no experience with terminal commands or linux, see a few basic commands and maybe watch an introductory video on the linux filesystem hierarchy.

To connect with SSH or SFTP, you need to use a client program.

SSH and SFTP usage

Open your client software. Input your user ID, password and server IP address as appropriate.

Left: the PuTTy SSH client. Right: the WinSCP SFTP client. Their interfaces differ but the credentials to connect are identical.

SFTP clients normally also include an SSH terminal feature.

Remote desktops

Users may be tempted to skip learning SSH terminal commands if they can just get a graphical interface (GUI). However, note that GUI applications consume more bandwidth, memory and cpu resources than their commandline counterparts. Most research-related work will not require a GUI.

Windows users may be familiar with software like Teamviewer or the Windows Remote Desktop viewer (MSRDC). In Linux, remote graphics typically involves X11 server forwarding or a VNC connection. Viewer software names include Xming and UltraVNC.

Remote desktop options: X11 vs VNC:

X forwarding sends a single application window, typically without compression or network optimization. VNC sends the entire desktop and is optimized for networked usage, such as persisting after an accidental disconnect. The former uses the default port range 6000+N, the latter 5900+N.

See our guides for more specific instructions on how to connect using remote graphics.

Windows Clients

  • Modern powershell or PuTTy are some of the many clients available for SSH
  • WinSCP or Filezilla are typical SFTP clients.

SSH Port forwarding (tunneling)

In simple terms, you first setup a tunnel running in the background, e.g. a minimized PuTTy terminal. After that your main application (e.g. browser, git client, VNC/X11 client) talks to a localhost port instead of directly addressing an external address/port; the SSH connection transparently forwards that data.

The syntax in powershell or bash is: ssh -L local_port:remote_address:remote_port username@server.com You can then leave that tunnel open in the background, traffic targeting localport will move through it. This will be the recommended method for connecting (including Jupyter Notebooks) once the firewalls are hardened.

See also