...
Host gateway
User myself
ProxyCommand ssh -X firewall /usr/bin/nc %h %p
Now when you say
bash$ ssh cpu-b12-xyz
herethen ssh will transparently set up the multi-hop connection. Note that others options can be passed and work as expected, i.e., you can set up port forwarding to the target machine, e.g.,
bash$ ssh cpu-b12-xyz -L8000:localhost:9000
...
When you run an interactive session from remote then this often carries a lot of context information (environment, running processes etc.). It can be very painful if you get disconnected and as a consequence lose all of this context and have long-running build processes killed. Use the 'screen
' utility. If you work on AFS then screen
also keeps your tokens alive for you (until they expire, of course) - provided that you run a pagsh:
bash$ screen pagsh
You start authenticating yourself (kinit -f; aklog
) and then go about your business. You can at any time disconnect from the screen (which continues running all of its sub-processes and keeps terminal history etc) by hitting "<CTRL>-A D"
. You can then safely log-out and when you come back resume your screen session (hopefully that vivado build has completed in the mean time)
bash$ screen -r
If there are multiple screen sessions running then you may have to specify which one to resume. The above also works if you have been interrupted (e.g., by losing connectivity) but if screen things the last connection is still alive then you might have to reattach forcefully
bash$ screen -Dr
While you can run X11 over ssh it is frustratingly slow if your connection is not super-fast. VNC is a much better solution (for use with a windows client see here). Plus, if you run your VNC server inside a screen/pagsh then you can disconnect and reconnect to your GUI without killing the GUI application . Of course, the VNC connection can be tunneled with ssh. The TightVNC
vncviewer
which is available under linux can be instructed to do so.
On the 'inside' you typically start a vncserver inside a screen/pagsh session (see above). Use a screen geometry that fits your remote viewer (client)
bash$ vncserver -geometry 1920x1200
New 'somemachine:1 (strauman)' desktop is somemachine:1
Once the server is up it prints its 'X11 display' information (e.g., which you use to set up the DISPLAY
environment variable.
bash$ export DISPLAY=:1
After this step you can start GUI applications, e.g., (ruckus)
bash$ make gui
On linux you can conveniently use the 'via' option to connect via ssh (this can be a multihop nickname as described above).
bash$ vncviewer -via somemachine :1
where ':1' is the X11 display matching the info given by the server (note the blank space between the machine name which is an argument to -via and the display argument). If – for some reason – you use a different kind of tunnel or connection then the viewer might believe it is directly connected to the server. In this case you probably want to explicitly specify an efficient encoding - otherwise your experience will be frustratingly slow...