|
2008-12-11
, 12:17
|
|
Posts: 3,397 |
Thanked: 1,212 times |
Joined on Jul 2008
@ Netherlands
|
#12
|
[1|root@minidemon|~]ls /etc/sysconfig/iptables
ls: /etc/sysconfig/iptables: No such file or directory
|
2008-12-11
, 12:50
|
|
Posts: 531 |
Thanked: 79 times |
Joined on Oct 2006
@ This side of insane, that side of genius
|
#13
|
ls -l `which iptables`
|
2008-12-11
, 14:05
|
|
Posts: 3,397 |
Thanked: 1,212 times |
Joined on Jul 2008
@ Netherlands
|
#14
|
|
2008-12-11
, 16:11
|
|
Posts: 546 |
Thanked: 85 times |
Joined on Feb 2008
@ Winnipeg, Canada
|
#15
|
Thanks, great tip! I'd offer the following change for those who want remote SSH access to their Nokia from anywhere - and if I typed something wrong, please correct me - I'm no iptables guru, but it seems to work here!
Code:#!/bin/sh iptables -F iptables -A INPUT -p all -s 127.0.0.1 -j ACCEPT iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p tcp --syn -j DROP
NOTE you should accept traffic to/from local loopback device instead of 127.0.0.1. You should deny traffic from 127.0.0.1 on network because this can only be spoofed traffic. However, I'm no IPT wizard; I prefer OpenBSD PF.
#!/bin/sh iptables -F iptables -A INPUT -p all -s loopback -j ACCEPT iptables -A INPUT -p tcp --dport 22 -j ACCEPT iptables -A INPUT -p tcp --syn -j DROP
ssh -R 9999:localhost:22 -l remuser -p remport -N remote.site.com
|
2008-12-11
, 16:44
|
|
Posts: 531 |
Thanked: 79 times |
Joined on Oct 2006
@ This side of insane, that side of genius
|
#16
|
iptables -A INPUT -p all -s lo -j ACCEPT
ListenAddress 0.0.0.0
|
2008-12-12
, 15:11
|
|
Posts: 546 |
Thanked: 85 times |
Joined on Feb 2008
@ Winnipeg, Canada
|
#17
|
no, it should be
since ifconfig uses the lo convention, not loopback for the name of that interface.Code:iptables -A INPUT -p all -s lo -j ACCEPT
as far as the reverse port forwarding you do with ssh, i dont think that would be killed via iptables, because the traffic would be tunneled through ssh, not be a seperate connection. you would have to be listening for ssh on all interfaces too, not just the wlan0 interface.
you sshd_config should have the following directive:
Code:ListenAddress 0.0.0.0
|
2008-12-12
, 16:39
|
|
Posts: 531 |
Thanked: 79 times |
Joined on Oct 2006
@ This side of insane, that side of genius
|
#18
|
The Following User Says Thank You to brendan For This Useful Post: | ||
|
2008-12-12
, 16:41
|
|
Posts: 531 |
Thanked: 79 times |
Joined on Oct 2006
@ This side of insane, that side of genius
|
#19
|
netstat -na |grep 22
The Following User Says Thank You to brendan For This Useful Post: | ||
|
2008-12-12
, 17:19
|
|
Posts: 546 |
Thanked: 85 times |
Joined on Feb 2008
@ Winnipeg, Canada
|
#20
|
since the ListenAddress is commented out with 0.0.0.0 as a value, that means its the default, and therefore the daemon listens on all interfaces.
should confirmCode:netstat -na |grep 22
~/bin$ netstat -an | grep :22 tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:61466 127.0.0.1:22 ESTABLISHED tcp 0 0 127.0.0.1:22 127.0.0.1:61466 ESTABLISHED
ls: /etc/sysconfig/iptables: No such file or directory