====== Tunneling using SSHuttle ======
This document explains how to connect to Comet, Rocket, or any other Unix-like server from off-campus using the [[https://github.com/sshuttle/sshuttle|SSHuttle]] software.
Intended audience:
* Comet, Rocket HPC users
* Other on-Campus, unix-like, server users
''sshuttle'' is a tool for advanced Linux users to implement a pseudo-VPN / pseudo-Proxy using SSH. With it you can access on-Campus resources using **unix.ncl.ac.uk** similar to our [[:started:connecting_offsite|Connecting to HPC (Off Campus)]] guide.
This is __not__ meant as a general tool for users unfamiliar with unix / Linux. We recommend that Windows users use [[:started:connecting_offsite#mobaxterm|MobaXterm]] unless there is a specific reason to use SSHuttle.
===== Prerequisites =====
- You will need a [[https://services.ncl.ac.uk/itservice/technical-services/unix-time-sharing/ | Unix timeshare service]] account.
- You will need a login account on the Unix-like server that you intend to login to. If you are using Comet or Rocket, you will need access via a [[https://hpc.researchcomputing.ncl.ac.uk/dokuwiki/doku.php?id=started:register#applying_for_an_account|HPC project]].
- You will need to [[https://sshuttle.readthedocs.io/en/stable/installation.html | install SShuttle ]] to your computer. If you opt for the PyPI route, I recommend using a virtualenv rather than installing the package as root.
===== Configuration =====
After you have satisfied all the pre-requisites, in your home directory //on the device you want to connect from//, create a file called ''finan.conf'' and copy the following text into it, replacing //nuser123// with your own Campus username:
--dns
-r
nuser123@finan.ncl.ac.uk
10.0.0.0/8
128.240.0.0/16
--to-ns=dns0.ncl.ac.uk
-x
128.240.212.70/32
Save the file.
===== Using SSHuttle =====
- As per our [[:started:connecting_offsite|Connecting to HPC (Off Campus)]] guide, you still need to [[https://services.ncl.ac.uk/itservice/technical-services/unix-time-sharing/ssh/#connect-step2|request a login session on Finan]] at the [[https://ama.ncl.ac.uk|Application Access Portal]].
- Open a terminal on your computer and type ''sshuttle @finan.conf'' followed by the enter key.
- Enter your Campus password, followed by the enter key, when requested. You can also [[https://hpc.researchcomputing.ncl.ac.uk/dokuwiki/doku.php?id=advanced:ssh_keys | set up an SSH public key]] on Finan to avoid this step.
- When you see //c : Connected to server.// in the terminal you started SSHuttle in, you can open another terminal and SSH to Comet, Rocket, or the Unix-like server that you wish to use. You can also use Midnight Commander, SFTP, and similar applications to copy files.
===== Troubleshooting =====
==== You get sshuttle: error: [Errno 2] No such file or directory: 'finan.conf' ====
* Make sure you didn't delete the finan.conf file.
* Key ''cd'' to take you back to your home directory and then rerun SSHuttle.
----
[[:advanced:index|Back to Advanced Topics]]