LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   ssh to firewall then to computer (http://www.linuxquestions.org/questions/linux-networking-3/ssh-to-firewall-then-to-computer-520975/)

jonfa 01-19-2007 05:12 PM

ssh to firewall then to computer
 
Hi All,

I have set up a firewall with Centos and I have other Centos boxes behind it. I want to ssh to the machines behind the firewall, but I don't really understand the syntax to do so. I can ssh to the firewall box with no problem. Any ideas?

Thanks.

Tux-Slack 01-19-2007 05:40 PM

then ssh next to the machine behind it
use the local ip address of it
i.e. ssh 192.168.26.15

capn_hector 01-19-2007 06:22 PM

Quote:

Originally Posted by Tux-Slack
then ssh next to the machine behind it
use the local ip address of it
i.e. ssh 192.168.26.15


a little clarification, ssh into your router (ssh root@router-public-ip) and then in your ssh session since your connected into your router controlling it, ssh to your other machines (ssh root@local-machine-ip)

this does work, i set up openwrt and did this alot. its just opening up port 22 in your firewall so your router accepts connections from the world.

unSpawn 01-19-2007 07:14 PM

For easier accessing machines behind a fw check out the excellent "Breaking Firewalls with OpenSSH and PuTTY".

Tux-Slack 01-20-2007 01:58 AM

or you could do it like this
firewall ssh port 22 open, rule ACCEPT in iptables
and for your local machine behind the firewall ssh port 23 i.e.
and in the firewall of your router forward the port 23 to the local machine
so when you ssh to your machine behind your router-firewall you would just connect to port 23 and you would get direct access to the machine behind the firewall


All times are GMT -5. The time now is 11:12 AM.