View previous topic :: View next topic |
Author |
Message |
DigitalDan Tux's lil' helper
Joined: 18 Nov 2002 Posts: 113 Location: Chicago
|
Posted: Sat Mar 13, 2004 8:13 pm Post subject: connect to server off campus*FIXED* |
|
|
I am trying to connect to my news server off campus but the server only allows local .edu connections. I can ssh into a server on campus, but I am not really sure of how to set up fordwarding through that connection.
I hope thats clear. _________________ gentoo baby, its the only way!
Last edited by DigitalDan on Sun Mar 14, 2004 10:56 pm; edited 1 time in total |
|
Back to top |
|
|
cuban Guru
Joined: 23 Aug 2003 Posts: 448 Location: Houston, TX
|
Posted: Sat Mar 13, 2004 9:03 pm Post subject: |
|
|
From man ssh:
Code: | -L port:host:hostport
Specifies that the given port on the local (client) host is to be
forwarded to the given host and port on the remote side. This
works by allocating a socket to listen to port on the local side,
and whenever a connection is made to this port, the connection is
forwarded over the secure channel, and a connection is made to
host port hostport from the remote machine. Port forwardings can
also be specified in the configuration file. Only root can for-
ward privileged ports. IPv6 addresses can be specified with an
alternative syntax: port/host/hostport
-R port:host:hostport
Specifies that the given port on the remote (server) host is to
be forwarded to the given host and port on the local side. This
works by allocating a socket to listen to port on the remote
side, and whenever a connection is made to this port, the connec-
tion is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine. Port forward-
ings can also be specified in the configuration file. Privileged
ports can be forwarded only when logging in as root on the remote
machine. IPv6 addresses can be specified with an alternative
syntax: port/host/hostport |
You'll want to use -L... so
Code: | $ ssh -l username -L 1337:localhost:1337 server.domain.tld |
I think NNTP is port 119.
Have fun,
Daniel _________________ Tell your ISP to support SPF/SASL AUTH (http://spf.pobox.com) today! |
|
Back to top |
|
|
DigitalDan Tux's lil' helper
Joined: 18 Nov 2002 Posts: 113 Location: Chicago
|
Posted: Sun Mar 14, 2004 5:14 pm Post subject: |
|
|
I tried that but it still does not work. I don't know if my local port is being forwarded through ssh then the connection to the news server is being made on the server that I connected to by ssh.
When I do run the command it just connects to the server, lets say server.domain.tld, and thats all. _________________ gentoo baby, its the only way! |
|
Back to top |
|
|
cuban Guru
Joined: 23 Aug 2003 Posts: 448 Location: Houston, TX
|
Posted: Sun Mar 14, 2004 5:20 pm Post subject: |
|
|
Maybe the news server isn't being run on localhost on that machine?
Try -L 1337:REMOTEMACHINESLOCALIP:1337 externalip
So for me -L 1337:192.168.5.3:1337 externalip
Also, to see if the port is connected do this:
Code: | # netstat -lnp | grep -i ssh |
Daniel _________________ Tell your ISP to support SPF/SASL AUTH (http://spf.pobox.com) today! |
|
Back to top |
|
|
DigitalDan Tux's lil' helper
Joined: 18 Nov 2002 Posts: 113 Location: Chicago
|
Posted: Sun Mar 14, 2004 6:12 pm Post subject: |
|
|
I see what I am doing wrong now and I don't know if there is a fix for it. There are 2 different servers, the one that I have access to, through ssh, from off campus and the news server one, that you have to be on campus to use.
What I was thinking is that I can connect to the server I have access to, then through that server I can connect to the news server. _________________ gentoo baby, its the only way! |
|
Back to top |
|
|
grimshaw Tux's lil' helper
Joined: 07 Aug 2003 Posts: 101 Location: Greensboro, NC 27403, USA, Earth
|
Posted: Sun Mar 14, 2004 9:49 pm Post subject: |
|
|
The advice here has been quite good. It was, in fact, very close.
Home machine:
ssh -l username -L 1337:ip.of.news.host:119 ip.of.ssh.host
This redirecets all traffic from local host sent to the local port of 1337 to the remote host port of 119 on the news server after you attach to the ssh login host.
You will, in turn, have to set the local news client to use the new port (1337).
- John
ps - This is an untested command (something I normally don't do before posting). I just don't have anything to test it on at the moment. _________________ All that is necessary for the triumph of evil is that good men do nothing.
-- Edmund Burke (1729-1797) |
|
Back to top |
|
|
DigitalDan Tux's lil' helper
Joined: 18 Nov 2002 Posts: 113 Location: Chicago
|
Posted: Sun Mar 14, 2004 10:56 pm Post subject: |
|
|
Great it worked, thanks a lot to both of you.
What I didn't do was setup in pan the new server, which is now localhost:1337. Now it does the forwarding perfectly. _________________ gentoo baby, its the only way! |
|
Back to top |
|
|
|