Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to set up a Ubuntu openssh (or telnet) server where the network environment is

  • can connect to any other host via any tcp/udp port.

  • but cannot accept incoming connections from other clients.

  • no UPnP in NAT

Is there any solutions to control this server from outer network?

for example,

  1. the server A connects to a outer server B.
  2. user connects to the server B.
  3. server B redirects any packets from user to server A.
share|improve this question
    
Setup port forwarding on the NAT device. –  Chris S Jun 1 '11 at 14:31
    
It seems that the NAT depth is 2 or more, so I can't. –  shkim Jun 1 '11 at 14:42
1  
Setup port forwarding on both (or more) NATs. –  Chris S Jun 1 '11 at 14:49
    
I have no access control on NATs. –  shkim Jun 1 '11 at 15:19
add comment

1 Answer

up vote 1 down vote accepted

Either:

  • Set up port forwarding through the NAT (on as many NAT boxen as you have)

or

  • SSH out from the machine to another box and use -R (*R*emote port forwarding) to pass the connection through.
    See man ssh for additional information.

The first is more correct. The second can be implemented without access to the NAT rulesets, and is probably a bit more secure than setting up port forwarding without additional IP access control lists...

Note that if you're doing this to circumvent security policies in place at whatever organization you work with you will probably be beaten severely by the local sysadmin when they discover the SSH traffic.

share|improve this answer
    
Thanks, I'll read about 'ssh out'. It's publicly open environment, not a company, and there's no security admin. –  shkim Jun 1 '11 at 15:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.