How to install sshoot on Linux?

sshoot is used, along with sshuttle, to manage multiple sshuttle VPN sessions through the command line interface. sshuttle allows us to create a VPN connection from your machine to any remote server that you can connect to via ssh, as long as that server has python 3.8 or higher. To work, we must have root access on the local machine, but we can have a normal account on the server.

We can also run sshuttle more than once simultaneously on a single client machine, connecting to a different server every time, so we can be connected to more than one VPN at once.

sshoot allows defining multiple VPN sessions using sshuttle and start/stop them as needed. It supports configuration options for most of sshuttle‘s features, thus, providing flexible configuration for profiles.

Installing sshoot

There are multiple ways through which you can install sshoot on our Linux PC. We will discuss all these steps one by one.

  • Using default package manager
  • Installing via Pip
  • Installing via Snap

We will install sshoot and also shuttle together, as both needs to be installed on your system to work in tandem. So let’s get started!

Method 1: Using default package manager

Open your Terminal, and follow the command according to your distribution.

Debian stretch / Ubuntu 16.04 or later:

sudo apt-get install sshuttle sshoot

If your system shows you the error “Unable to locate package sshoot“, like this below image.

Unable To Locate Package Sshoot
“Unable to locate package sshoot” Error

Then, you can use other methods mentioned in this article to install this tool on your distribution.

Install Only Sshuttle
Installing just sshuttle using the package manager

Method 2: Installing via Pip

On any other Linux distribution, such as Arch Linux or Fedora workstation, We can also install sshoot using pip. If the previous method not worked for you, then open a fresh Terminal tab and run the below given command.

sudo apt install -y virtualenv
virtualenv -p python3 /tmp/sshuttle
. /tmp/sshuttle/bin/activate
pip install sshuttle sshoot
Installing Sshuttle And Sshoot Using Pip
Installing sshuttle and sshoot using pip

This will install sshuttle and sshoot in python virtual environment named sshuttle. If you want to know more about python virtual environment, this article will help.

Here apt is for Debian based distros, for Red hat based distros it will be yum or dnf. Change apt according to your distribution.

Method 3: Installing via Snap

If you don’t have installed snap on your Linux PC, follow this guide and install using the commands according to your OS. For Debian, follow below given command:

sudo apt update
sudo apt install snapd
sudo snap install core
Installing Snap 1
Installing snap

Now, Install sshoot using snap:

sudo snap install --classic sshoot
Installing Sshoot Using Snap
Installing sshoot using snap

Sshoot has installed using snap. We can check all the installed snap application using below command:

snap list
List Of Snap Applications
List of snap applications

Now, we have successfully installed sshoot using all above-mentioned three methods on our Linux PC.

Using up sshuttle and sshoot

sshuttle Syntax

This command line tool follows a very simple syntax:

sshuttle [options...] [-r [username@]sshserver[:port]] [subnets]

sshuttle Examples

I used the following command, to connect another Linux PC: (Where me is username and 192.168.1.6 is IP address of that PC. And 0.0.0.0/0 subnet can also be written as 0/0)

sudo sshuttle -r me@192.168.1.6 0.0.0.0/0
Running Shuttle
Running shuttle

When it starts, sshuttle creates an ssh session to the server specified by the -r option.

We don’t need to install sshuttle on the remote server; the remote server just needs to have python available, and then sshuttle will automatically upload and run its source code to the remote python interpreter.

If you installed shuttle and sshoot via pip method, then run these commands in that specific python environment. Because shuttle and sshoot has installed for that environment only.


Create a sshoot profile

In order to create a profile, run the following command:

sshoot create -r me@192.168.1.6 vpn1 0/0
Creating A Sshoot Profile
Creating a sshoot profile

Where,

  • me is username of remote Linux server or PC
  • 192.168.1.6 is IP address on server
  • vpn1 is name of this sshoot profile
  • 0/0 is subnet for profile

We can list out all existing profiles using below command.

sshoot list
Sshoot Profiles List
sshoot profiles list

Some useful sshoot commands:

sshoot start [profile name]      #To start a profile
sshoot stop [profile name]       #To stop a profile
sshoot delete [profile name]     #To delete a profile
sshoot --help                    #Help for sshoot

Conclusion

In this module, we discussed sshoot which is used for managing multiple sshutte VPN profiles, and how to install it on our Linux system. We installed sshoot on our Linux in three different ways, one way by using default package manager, secondly via pip and finally with snap.

We hope this article helped you to understand how shuttle ans sshoot works together.

Also Read