I have a serious problem with my institute's firewall. I have a Rackspace Cloud server instance that is configured to accept SSH connections on port 6xxx. When I was using port 22 there wasn't any problem; but when I switched to port 6xxx I cant connect using SSH. This is probably about our institute's firewall policy, as only the ports below 1024 can be listened by root processes on *nix. Is there a trick I can use to connect for once? I will add a MAC-based rule to allow my device.

Edit: I'm using iptables on CentOS 5.x

Best regards, Deniz

migrated from stackoverflow.com Apr 21 '11 at 22:37

This question came from our site for professional and enthusiast programmers.

  • evading school firewalls is probably a violation of acceptable use policies, and may have you kicked out if you get caught. Its probably better you ask your school for permission – Journeyman Geek Apr 21 '11 at 23:56
  • Have you modified your iptables to handle the 6xxx port? – fpmurphy Apr 22 '11 at 15:10
  • @journeyman-geek Actually, I am looking for a legal method. Like forwarding requests on port 22 from my device's MAC address to port 6666 at the server. All I need is to connect through port 22 but connect on port 6666. – Deniz Acay Apr 23 '11 at 22:56
  • @fpmurphy Yes, my server accepts new connections on port 6xxx. – Deniz Acay Apr 23 '11 at 23:01

Here are a couple of easy options that don't involve circumventing the firewall at all:

A. If you have access to a third machine (outside of the network), ssh to that on port 22 and then jump from there. See ssh-tunnel-via-multiple-hops as a starting point.

B. Just revert to port 22 (or 443 or anything else that is open). If your server is up-to-date and you follow the usual precautions for running ssh, it's really not an issue. Install fail2ban or similar to auto ban anyone poking around. Tie it to you MAC address and an IP range if you like.

Honestly, if you aren't set up securely enough to run ssh on port 22, you shouldn't be running it at all.


This might be overkill for your purposes, but Tor is pretty good at circumventing outbound firewalls.

As @journeyman-geek noted, getting permission from TPTB is probably in your interests.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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