P
P
psngut2017-04-16 11:32:07
SSH
psngut, 2017-04-16 11:32:07

How to restrict access to SSH tunnel by IP?

THE ESSENCE IS THIS
Created a ssh connection
example $ ssh -D:8080 [email protected]
how to make 188.225.72.45:8080 restrict login by ip

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2017-04-16
@saboteur_kiev

close port 8080 via iptables for everything except your IP
# close port 8080 for everything
iptables -P INPUT DROP --dports 8080
# open port 8080 for address
iptables -A INPUT -m multiport --dports 22,5432 -s 188.225.72.45 -j ACCEPT

P
psngut, 2017-04-16
@psngut

iptables -A INPUT -m multiport --dports 22,5432 -s 188.225.72.45 -j ACCEPT
iptables v1.6.0: multiport needs `-p tcp', `-p udp', `-p udplite', `-p sctp ' or `-p dccp'
Try `iptables -h' or 'iptables --help' for more information.
how to fix the error

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question