I want move SSH to port 443, but is used by https. In /etc/apache2/ports.conf I commented the lines for listen by this port. In the default site available also commented the lines. For finish, I complete stop apache service, but yet I receive this:

$ sudo lsof -i :443
sshd    32156 root    3u  IPv4 2415725      0t0  TCP *:https (LISTEN)
sshd    32156 root    4u  IPv6 2415727      0t0  TCP *:https (LISTEN)

I don't understand why https continue there if Apache is down?

note: Debian 3.2.60-1+deb7u3 / Apache/2.2.22


From that output it looks like ssh is listening on port 443. Under where it COMMAND is the application or service that is running. Under NAME you have *:https That says sshd is listening on all interfaces on port https (443)

I think what might be confusing is the name of the port protocol verses the actual port number that is showing up.

My sshd is still on port 22 and I see

sudo lsof -i :22 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME sshd 976 root 3u IPv4 9173 0t0 TCP *:ssh (LISTEN) sshd 976 root 4u IPv6 9175 0t0 TCP *:ssh (LISTEN)

Where as for apache you can see that the command is different

sudo lsof -i :80 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME apache2 6131 root 4u IPv6 60547 0t0 TCP *:http (LISTEN) apache2 26677 www-data 4u IPv6 60547 0t0 TCP *:http (LISTEN)

  • lsof -i :80 -P will display port numbers instead of names. – Jason C Apr 28 '15 at 19:48
  • mm thank you! Let 'use you' for a question ;) So, why ssh server -p 443 don't answer? what more I must review? – HEDMON Apr 28 '15 at 19:49
  • There could be a few things. Firewall sudo iptables -L, you might need to restart sshd, check netstat -an |grep LISTEN to make sure that the port is being used and listened on. Check your logs for sshd and see if it is throwing an error. – grag42 Apr 28 '15 at 19:57
  • I forgot comment it, just for the records: I'm not sure why, but after restart the server everything was ok. Before I just was restarting the services. – HEDMON Jun 9 '15 at 22:40

There's a list at /etc/services used to convert port numbers to protocol names to increase readability. The first column clearly says that there's sshd, not apache.

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.