tunnel with a shell account?
Here is what I'm looking to do:
I want to login to a remote Linux ssh shell and use some utility (I'm thinking netcat) to open a port on the remote machine. Call this port X. When someone (I) connects to port X on the remote shell, I want it to forward all the traffic to another remote machine at port Y.
box1 --> Linux ssh shell (box2) to open port X which will forward to box3 port Y
box1 --> box2 port X --> box3 port Y
I want to do this because box1 is blocked via firewall to box3, but box2 is not
I am admin/root on box1 and box3 but not on box2
I know I can just open box3's firewall to allow box1, but box1 will always have a different IP
box2 and box3 will always have the same IP address.
Can I accomplish this with netcat?
If not, what utility can I use to accomplish this?
box1 will almost always be a XP Pro box. box3 is either 2K Server or XP Pro
box2 will always be a Linux box.
My other option is to just open up a vpn on box3 and allow from two ISPs netblocks.
However, box1 will not always have vpn client software on it...
Thanks for any insight!
Re: tunnel with a shell account?
Quote:
Originally posted here by phishphreek80
Here is what I'm looking to do:
I want to login to a remote Linux ssh shell and use some utility (I'm thinking netcat) to open a port on the remote machine. Call this port X. When someone (I) connects to port X on the remote shell, I want it to forward all the traffic to another remote machine at port Y.
box1 --> Linux ssh shell (box2) to open port X which will forward to box3 port Y
box1 --> box2 port X --> box3 port Y
I want to do this because box1 is blocked via firewall to box3, but box2 is not
I am admin/root on box1 and box3 but not on box2
I know I can just open box3's firewall to allow box1, but box1 will always have a different IP
box2 and box3 will always have the same IP address.
Can I accomplish this with netcat?
I am not quite sure I understand this... you want to log in to a remote machine via ssh and have it automatically forward your connection to box 3 on an unknown port? How can you not know what port Y is?
ssh -N -f -L 3389:box3:3389 user@box2 is what you want to use to forward a connection. You can use this to tunnel RDP through ssh btw.
This lets you configure a tunnel between your box1 and your box3 using your account on Box2..
I'd consider looking in to configuring an ssh-agent for your user account.
Quote:
If not, what utility can I use to accomplish this?
Certainly don't use netcat for this..although it would work..
Quote:
box1 will almost always be a XP Pro box. box3 is either 2K Server or XP Pro
box2 will always be a Linux box.
My other option is to just open up a vpn on box3 and allow from two ISPs netblocks.
However, box1 will not always have vpn client software on it...
XP pro has built in VPN client software albeit to a lesser degree.
You can also open your sshd at home and try to set up a reverse shell with the -R flag. Given that I don't know your current situation all that well...I don't know if it would work.
Quote:
Thanks for any insight!