Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 1.1 KB

no-tor-ssh.md

File metadata and controls

42 lines (32 loc) · 1.1 KB

SSH over Tor is very slow

Yet Tor provides more privacy

If you still want to SSH over the without Tor (e.g. only over local network) you can do this:

  1. Write down your IP adress. To look it up run sudo ifconfig
  2. Allow SSH in the firewall sudo vi /etc/iptables/rules.v4 then add "Allow SSH" line so it's like this:
*filter
:INPUT DROP [152:211958]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [52247:3125304]
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT

# <-------- Allow SSH from home network only !
-A INPUT -p tcp -s 192.168.0.0/16  --dport 22 -j ACCEPT
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT

COMMIT
  • Leave IPv6 rules as the inital "Drop-everything" setup because most home networks do not need IPv6.
  1. Run
sudo /etc/init.d/netfilter-persistent restart
  1. Finally, back on your laptop, test your local ssh:
ssh -i ~/.ssh/minibank_id_rsa <PI_USER_NAME>@<LOCAL_IP_HERE>
  1. add an alias
echo 'alias mb4l="ssh -i ~/.ssh/minibank_id_rsa <PI_USER_NAME>@<LOCAL_IP_HERE>"' >> ~/.bash_profile
. ~/.bash_profile

Now type mb4l and that should log you into the Pi.