I am using RedHat OpenShift server to deploy my WebApps.

To access the contents of my application I have to SSH into their server, e.g.:

ssh [email protected]

But the ssh fails, because of outgoing 22 port being blocked. Also, I don't have any public IP assigned system for port forwarding.

Is there any way to make the ssh work?

  • 4
    The proper thing to do is asking them access, maybe a VPN account. Commented Feb 2, 2018 at 10:42
  • 1
    @RuiFRibeiro Yeah, it's at least in part a social problem, not only technical.
    – Kusalananda
    Commented Feb 2, 2018 at 10:43

5 Answers 5


You must contact whoever is in charge of the network, and convince them that your access request is legitimate. Regardless of the sanity of the access restrictions, circumventing them will at the very least land you in hot water with your boss, and could even be taken as "hacking" and get you prosecuted.


DISCLAIMER: All the solutions on this answer, can lead you to be fired for violating your organization security policy. If there is a Network Administrator that is constantly checking for abnormal traffic peaks and patterns, you could be caught. If you don't want to follow the path of making a technical kludge to get the access, i suggest you to follow vonbrand's answer and request the access in a legal way.

As the one that is asking shown at the comments it's intention to avoid security policies using affirmatives like "i have no root access" and "this port is blocked at my company" at the comments, the same way it is using a throwaway account, I took the liberty to remove technical details that would facilitate the process of creating the "solutions" from my answer. However, the idea remains cause that is the principle of the hacker way of think, a skill that anyone working with IT should have.

Option 1: Put ssh to listen on a different port.

Option 2: Redirect the traffic incoming from another port to tcp/22(ssh)

Option 3: Use shellinabox to make a remote web terminal.AVOID USING HTTP. Use a certificate as explained at the shellinabox manpages, even if it is self-signed.

Option 4(non-root solution): Pay for a simple server at a cloud provider(one that costs 5-10US$ month) to have a ssh jumpbox.

  • Upvoted because shellinabox looks very handy! Commented Jan 6, 2016 at 12:41
  • I am not having root access for the host I am trying to log into. :(
    – raptor
    Commented Jan 6, 2016 at 22:51
  • 1
    I deleted my comment because this question is OLD, and the user wont come back. Obviously I would fire someone circumventing security policies and opening new security holes. There is no need for constantly checking, either syslogs from system or firewalls, or even a netflow server. Or at worst, it will become very visible when worms find out the ssh tunnel and start hammering you with ssh requests. Commented Feb 2, 2018 at 11:03
  • 2
    Yeah. and i've noticed that I gave this answer years ago, and forgot to tell the basics about legal stuff. Today, I got an Upvote and felt guilty about it so, mistakes we make and try to fix during our short lifetime on this planet :)
    – user34720
    Commented Feb 2, 2018 at 11:09
  • 2
    @nwildner It happens! the only ones who do not make mistakes are the ones doing nothing. Commented Feb 2, 2018 at 11:11

I like to use sslh for this. It exploits the fact that different protocols start a connection differently. If it detects SSH, it forwards the connection to sshd and if it detects HTTPS it forwards the connection to httpd.

This allows you to have e.g. nginx/apache and ssh listening on the same port (usually 443).

  • That would be a perfect solution. But I do not have sudo access in Openshift server. Thereby I wont be able to install sslh.
    – raptor
    Commented Jan 6, 2016 at 22:49
  • In that case I suggest you look into ProxyCommand. E.g. ssh -o 'ProxyCommand=ssh -W %h:%p -p 443 jumphostuser@jumphost' finaluser@finalhost
    – ptman
    Commented Jan 7, 2016 at 5:24

The standard way to access the container in OpenShift is the oc cli tool.

you can use oc command line tool to access the shell. eventually, if you "need" to use your ssh client, you can forward the port with

oc port-forward <podname> 22:22

otw you can just use

oc rsh <podname> 

to access with a remote shell

for more info https://docs.openshift.com/enterprise/3.0/cli_reference/get_started_cli.html


Are you sure that the ssh server is set to use port 22? It is the standard configuration but can be changed. If this is the case and the new port is e.g. 123 try

ssh -p 123 [email protected]
  • yes ssh server is set to port 22. I cant change sshd file, because be insufficient privileges..
    – raptor
    Commented Jan 6, 2016 at 22:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .