Click to See Complete Forum and Search --> : Launching firewall from remote computer?
Tenny
06-10-2003, 11:51 PM
I'm sure this is a really easy answer but I can't figure it out.
How would I launch rc.firewall (/etc/rc.d/rc.firewall) from a remote computer via ssh / telnet. I figured a way to do it through webmin (sh script) but it doesn't work through telnet/ ssh all it does is run on the firewall on the computer that's being typed on etc...
Any help would be great.
Thanks,
Tenny
FyberOptyx
06-11-2003, 04:41 PM
Can you succesfully log onto other machine with ssh ?
hlrguy
06-11-2003, 05:31 PM
I am as confused as Fyber...after you ssh or telnet in, the commands run on the remote machine. Anyway, when you run any command remotely, you want to be sure and detach it from the xterm.
nohup <commandname> &
That way, if it is parented on the terminal you are executing from, it will not be killed when the terminal closes.
FyberOpTycs - The expression should be 'You can lead a horse to drink, but you can't make him water' :)
hlrguy
Tenny
06-11-2003, 06:17 PM
Well I dont use SSH; but my friend is, but yes.
I connect via telnet.
and i try running /etc/rc.d/rc.firewall
it runs that script... but it runs it on the computer I just typed it on.
get it?
hlrguy
06-11-2003, 06:28 PM
Let me ask a stupid question. After you telnet into the remote machine, in a terminal, you navigate to the directory on the remote machine in the same terminal and then ./<scripfilename> and it executes on the local machine?
I telecommute and use rsh, ssh, telnet 14M times per day to start things on my Solaris workstation...so I am having a hard time figuring this out.
You aren't connecting in one terminal then executing the script in another are you?
hlrguy
Tenny
06-11-2003, 08:12 PM
Here is what I get when I run it on my windows pc. (telnet from windows)
Red Hat Linux release 7.3 (Valhalla)
Kernel 2.4.18-3 on an i686
login: Tenny
Password:
Last login: Wed Jun 11 15:15:32 from 192.168.1.4
[Tenny@localhost Tenny]$ su
Password:
[root@localhost Tenny]# /etc/rc.d/rc.firewall
Loading simple rc.firewall version 0.63..
External Interface: ppp0
Internal Interface: eth1
loading modules: - Verifying that all kernel modules are ok
. Done loading modules.
enabling forwarding..
enabling DynamicAddr..
clearing any existing rules and setting default policy..
FWD: Allow all connections OUT and only existing and related ones IN
Port Forwarding: Port: 21 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 12203 IP: 192.168.1.3
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6112 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 27015 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 4443 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 14567 IP: 192.168.1.3
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 1080 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 14567 IP: 192.168.1.3
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 412 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 77777 IP: 192.168.1.3
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 69 IP: 192.168.1.10
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 80 IP: 192.168.1.4
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 25 IP: 192.168.1.4
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6112 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6112 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6200 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6200 IP: 192.168.1.2
/etc/rc.d/rc.firewall: iptables: command not found
Port Forwarding: Port: 6891 IP: 192.168.1.3
/etc/rc.d/rc.firewall: iptables: command not found
/etc/rc.d/rc.firewall: iptables: command not found
/etc/rc.d/rc.firewall: iptables: command not found
IPTables Blocking port 50
Enabling SNAT (MASQUERADE) functionality on ppp0
rc.firewall-2.4 v0.63 done.
[root@localhost Tenny]#
Now when I run it from the machine itself, everythings fine. When I run it from my 8.0 linux laptop it looses its 'internet connecti'n becuase its using the firewall from the server on itself.
hlrguy
06-11-2003, 10:54 PM
su - root
without the '- root' you will keep the user's profile, you need to load root's profile. Makes sense. It is running, or attempting to run, on the remote machine, it is just failing. I expect the above is the problem.
hlrguy
Tenny
06-11-2003, 11:50 PM
Worked! Great thanks m8!