Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
connect to server off campus*FIXED*
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
DigitalDan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 113
Location: Chicago

PostPosted: Sat Mar 13, 2004 8:13 pm    Post subject: connect to server off campus*FIXED* Reply with quote

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
View user's profile Send private message
cuban
Guru
Guru


Joined: 23 Aug 2003
Posts: 448
Location: Houston, TX

PostPosted: Sat Mar 13, 2004 9:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
DigitalDan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 113
Location: Chicago

PostPosted: Sun Mar 14, 2004 5:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
cuban
Guru
Guru


Joined: 23 Aug 2003
Posts: 448
Location: Houston, TX

PostPosted: Sun Mar 14, 2004 5:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
DigitalDan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 113
Location: Chicago

PostPosted: Sun Mar 14, 2004 6:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
grimshaw
Tux's lil' helper
Tux's lil' helper


Joined: 07 Aug 2003
Posts: 101
Location: Greensboro, NC 27403, USA, Earth

PostPosted: Sun Mar 14, 2004 9:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
DigitalDan
Tux's lil' helper
Tux's lil' helper


Joined: 18 Nov 2002
Posts: 113
Location: Chicago

PostPosted: Sun Mar 14, 2004 10:56 pm    Post subject: Reply with quote

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. :D
_________________
gentoo baby, its the only way!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum