Question

SSH via port 443 not responding; others ports OK

Posted August 28, 2015 11k views
Linux Basics Security Networking Firewall Configuration Management Control Panels Linux Commands

Hello Digital Ocean comrades,

I greet you as a newbie and, of course, with a basic question relating to challenges I am having getting an SSH connection to connect to port 443 on my Ubuntu droplet.

Let me first set the basics.

Installed and created droplet; followed instructions in excellent tutorials located at
https://www.digitalocean.com/community/tutorials/additional-recommended-steps-for-new-ubuntu-14-04-servers

have also reviewed and used portions of

https://www.digitalocean.com/community/tutorials/ssh-essentials-working-with-ssh-servers-clients-and-keys

Server is up and running. I was able to custom configure to connect to a specific port (27182) for SSH.

Now, I wish to add Port 443 connection for SSH. I have edited sshd_config to add Port 443 as well as Port 22

ufw has SSH enabled and ports 27182/tcp, 443/tcp and 22/tcp cleared for traffic.

From sshd_config

What ports, IPs and protocols we listen for

Port 27182
Port 443
Port 22

Use these options to restrict which interfaces/protocols sshd will bind to

from ufw

xxxxxxxxxxxxx:~$ sudo ufw status
Status: active

To Action From


27182/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
25/tcp ALLOW Anywhere
27182/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)
25/tcp (v6) ALLOW Anywhere (v6)

all edits to ssh_config were in nano and were saved. ssh was stopped then restarted

ufw has been reloaded.

I CAN telnet and puTTy connect to ports 27128 and to 22. I CANNOT get any sign of life from port 443… nothing.. telnet never responds to it and puTTy spits a connection error when attempting 443 connection from a windoze box; terminal from my mac delivers same results. Can connect to 27182 and 22 from mac OK.

All my web research suggests I should be able to run an SSH connection though port 443… yet I cannot get it to work.

Any ideas on what I should do next to unplug port 443 connection? I am new with unix, so kindly be patient. No doubt this is going to be a very basic configuration error or misunderstanding on my part.

Thanks,
michael

1 comment
  • Sir,

    Thank you for the suggestion. I do not have any processes running on 443 that I am AWARE of ..

    Xxxxxxxxxxxxx:~$ sudo netstat -punta | grep 443
    [sudo] password for xxxxxxx:
    tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 1234/sshd

    tcp 0 0 xxxxxxx.64.181:39639 216.58.221.142:443 ESTABLISHED 1995/2

    tcp 0 0 xxxxxx.64.181:49453 216.58.221.46:443 ESTABLISHED 1995/2

    tcp 0 0 xxxxxxx.64.181:443 77.57.112.173:64718 ESTABLISHED 1802/sshd: mecarboy
    tcp 0 0 xxxxxx.64.181:37746 216.58.221.67:443 ESTABLISHED 1995/2

    tcp 0 0 xxxxxx.64.181:49454 216.58.221.46:443 ESTABLISHED 1995/2

    tcp6 0 0 :::443 :::* LISTEN 1234/

    Um, in the realm of incredible dumb, have a started a process without realizing it that is blocking the port?

    Thanks,
    Michael

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

2 answers

Hello Mecarboy
Have you got a webserver running, wich could use port 443 default?
You can check your service running port with:

netstat -punta | grep 443

the -p flag will give you the process ID and the process name of whatever is using that port

the -u flag shows udp

the -n flag is for numerical addresses

the -t flag shows tcp

the -a shows listening and non-listening sockets

  • It doesnt look like your webserver is using 443 for https, but to be sure,

    • disable your default ssl virtualhost in apache/nginx
    • Restart apache/nginx and try again. If it doesnt work it could be your firewall, the server firewall or a misconfiguration

Just pick another port for SSH, it is conflicting with your web servers https port (default 443)

Submit an Answer