On Server Side
First edit "/etc/ssh/sshd_config"
PermitTunnel yes PermitRootLogin = yes
sudo service ssh restart
On Client Side
If there isn't a interface in server side yet
Add a network interface on server side
sudo ssh -f -o Tunnel=ethernet -w 0:0 root@ServerIP ifconfig tap0 10.5.5.1 netmask 255.255.255.0
Add a network interface on client side (it sometimes doesn't work, but it works anyway)
sudo ifconfig tap0 10.5.5.2 netmask 255.255.255.0 up
After you've set up the interface on server side...
Access server seeting up the port
sudo ssh -f -N -T -R 22222:localhost:22 ServerIP
Sometimes it's necessary to configure the
/etc/ssh/sshd_config in the client-side, to allow Tunel and root login.
On Server Side (Again)
Access the client using the port you've set up before
ssh -p 22222 root@localhost
If you're going to be accessing this host on a regular basis, you can also simplify access by adding a few lines to your
host anyhost User root Hostname localhost Port 22222
Then you can access the client like this: