How to Create an SSH Tunnel Server and Client in Linux
SSH is what is referred to as the Secure SHell protocol. SSH allows you to do a plethora of great things over a network, all while being heavily encrypted. You can make a remote accessible shell on your home computer that gives you access to all your files at home, and you can even tunnel all of your traffic to keep you anonymous and protected on public Wi-Fi. It has many great uses and is a must have tool for your arsenal. It was designed to replace the insecure Telnet protocol, which sends passwords through the network in plaintext.
First, follow this video demo to learn how to install and configure OpenSSH.
- sudo pacman -S openssh
- useradd -m -g users -G games newguy
- sudo nano /etc/ssh/sshd_config
- Allow TCP forwarding
- Enable any custom settings that you want if you know what you're doing.
- sudo rc.d sshd start
- ssh -p (port you want) newguy@localhost
To run encrypted traffic through your tunnel, start port forwarding and in the terminal, type:
ssh -ND 9070 <username>@<host IP> -p 6996
Then in your selected application, go to the network settings and forward traffic through SOCKSv5 port 9070. You will be safe from local network attacks and be heavily encrypted.
That's about it. Questions? Come visit us on IRC on Freenode, channel #nullbytez.