You are not logged in.

#1 2007-12-21 08:29:50

metalfan
Member
Registered: 2007-11-22
Posts: 99

[SOLVED]port redirect/routing question

Hi,

mypc - router - ( INTERNET ) - another pc
                                           - destination pc

"another pc" and "destination pc" are both connected to the internet via offical ips, but ports <1024 are blocked.
"another pc" can connect to "destination pc" via ssh (they are in the same network).
now i would like to connect to "another pc" and get redirected (dont know how) to "destination pc" port 22

"another pc" can connect to "destination pc" via ssh, but another pc is not my machine and i would prefer not to put my private key on it. also this solution should only work once.

This works if i want to connect to some machine inside a private lan over a router connected to the inet, but since "another pc" and "destination pc" are in the same network is nat the way to go?

iptables -t nat -A PREROUTING -p tcp -i ppp0 --dport 222 -j DNAT --to-destination 192.168.10.30:22

Any ideas?
greets
metalfan

Last edited by metalfan (2007-12-24 17:06:58)

Offline

#2 2007-12-21 16:49:42

metalfan
Member
Registered: 2007-11-22
Posts: 99

Re: [SOLVED]port redirect/routing question

You need openssh and tsocks

Run these commands from mypc
#tsocks configuration
/etc/tsocks.conf
server = 127.0.0.1

#this will start a shell on another, just let it run. port 1080 is the default port...no entry in /etc/tsocks.conf needed
ssh -D 1080 "another pc"
#or ssh -l yourloginnameon"another pc" -D 1080 "another pc"    #if its another user on "another pc"

#on another shell
tsocks ssh "destination pc"


took me one day to get this running, thx to Al_Berto@quakenet who solved the mistery.


greets
metalfan

Last edited by metalfan (2007-12-24 17:07:59)

Offline

Board footer

Powered by FluxBB