1

I'm trying to connect to Ubuntu using Putty via HTTPS (SSH via port 22 is blocked via the firewall). I read so many tutorials and sites about SSL, SSH, tunneling, ... that I'm kind of confused now. I can't sort out what the right way is, what technology/protocol I need and how to do that.

Environment

  • Ubuntu 16.04 TLS (fresh install hosted in a cloud service)
  • Putty on Windows 7 (local)
  • Web access only via proxy; already configured on my Win machine (port: 3128)
  • Firewall that kind of blocks anything (including port 22 for direct SSH access to the terminal on Ubuntu)

My observations and what I tried so far

Looking into the sshd_config on Ubuntu I can see that only Port 22 is enabled for SSH access. Adding Port 443 doesn't work. I guess it is due to the fact that still the same protocol is used?

Then I looked into the stunnel4 service. Using the tutorial here I configured everything and tried to connect but it fails. Even without the firewall (when trying from home). I guess the reason is that a tunnel is just used to kind of route through the Linux server?

Questions

So again: I want to connect to an SSH terminal via HTTPS from Windows (Putty) to Ubuntu.

  • What to use? e.g. tunneling, https, ...
  • How to configure the Ubuntu server (sshd deamon, stunnel4 service, ...)?
  • How to configure Putty?
5
  • Alternatively, you can use OpenVPN on port TCP 443 (HTTPS) to connect to your server and then SSH to the local IP of this server on your VPN (i.e. 10.0.8.1). This is not a solution, rather a workaround. Commented Jul 5, 2016 at 14:08
  • 1
    Even the title does not make sense. PuTTY can't connect to HTTPS. And later is it even worse. SSL is not port 22 (it is SSH!). Read more. You might use proxy, but you need more information than port. What type?
    – Jakuje
    Commented Jul 5, 2016 at 14:29
  • @Jakuje I corrected the SSH typo. However, the title should be ok? I want to connect from Windows to Linux using HTTPS (use the console). Regarding, the proxy, I have the hostname as well. The point is this is configured already and I need to go through that. Therefore, I thought I have to use HTTPS. Not sure what you mean with type.
    – Stephan
    Commented Jul 5, 2016 at 14:38
  • if it is HTTP proxy, SOCKS or something else.
    – Jakuje
    Commented Jul 5, 2016 at 14:39
  • HTTP proxy to my best knowledge. Just looked at SOCKS. Looks like I need a SOCKS proxy for that. Not sure if this will help to tunnel an SSH connection through that HTTP proxy. Or am I missing sth. here?
    – Stephan
    Commented Jul 5, 2016 at 14:44

2 Answers 2

1

Just configure your SSH daemon on Ubuntu to run at TCP:HTTPS port.

Then you need to configure Putty to use proxy and connect to the Ubuntu server using HTTPS port, that's all.

You can consider using SSH tunneling too, take a look here.

1
  • Hi Tim. I see you have linked to the same page on serversuit in several answers on different sites here. While this may be legitimate, I suggest that you avoid excessive linking to off-site resources (even for supplementary information) without clear explanation of how the linked page is useful. Answers on the Stack Exchange network are expected to stand on their own without relying on external resources, and if a large fraction of your posts link to a single external resource that may even be considered spam. Just a heads-up so you don't get unnecessary spam flags logged against your account.
    – user
    Commented Jul 13, 2016 at 15:32
0
  1. Have at least on SSH service listen on Port 443. Connect using Putty.
  2. If your server is behind NAT, port forward from 443 to 22.
  3. AjaxTerm.
  4. Tunneling as per another answer.
  5. RDP/VNC to an outside desktop and open Putty on that. This is very common for jump/bastion/restrictive NSG firewall holes for incoming (to server) traffic.

You must log in to answer this question.

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