Help - Search - Members - Calendar
Full Version: Sshd On Port 443
Linuxhelp > Support > Technical Support
pawelgm
Hey there.

Plaese dont disregard this as a newb question I have worked on debian for 3 years and just recently switched to Red Hat. Who would think Red Hat would be harder to set up than Debian smile.gif

Anyhow I can't get sshd to listen on port 443. On debian all i had to do is add a line to the sshd conf file "Port 443" and everything worked , but that is not that case here. Do any of U long time Red Hat users know what might be preventing it from getting that port. I am not running a apache so that is not huggin that port. I had no troble assigining it a port that is higher than 1024 for example "Port 6789" worked.

Thanks for all your help!
chrisw
edit the file /etc/ssh/sshd_config

uncomment the line in the file that reads:
#Port 22

uncomment it and replace 22 with your port number you wanna use and restart ssh

that should get it to work on the port you wanna use it on
pawelgm
thanks Chris but that is the problem. Changing the sshd config file dont work. It works on other port like I posted above but not on 443. There must be something alse going on behind the scene
chrisw
thats the same port that is use for https isnt it....
and you dont have apache running or anything....

in your /etc/services file....comment out
the lines that list port 443 and then restart your sshd server
and see what happens...
hughesjr
you probably have iptables configured to block all incoming traffic to all ports less than 1024 ... (that is one of the default settings).

Since you want to do port 443, you must add a line like this to your /etc/sysconfig/iptables file (it should be near the top of the file .... before any REJECT lines....

-A INPUT -p tcp -m tcp --dport 443 --syn -j ACCEPT

This will allow all IPs to connect to port 443 and will allow it to any IP or network card on the listening server... if you want to restrict the connection, there are many options ... if you only wanted a certain network to be able to connect, you could do this instead:

-A INPUT -p tcp -m tcp -s 192.168.0.0/255.255.255.0 --dport 443 --syn -j ACCEPT

would only allow PC's with the IP address in range 192.168.0.1 to 192.168.0.254 (source) to connect to port 443......

After you make the adjustment that is required to your /etc/sysconfig/iptables file, issue the command:

/etc/init.d/iptables restart

to enable the new settings and restart sshd with this command:

/etc/init.d/sshd restart

(make sure the port 443 line is in the /etc/sshd_config file...)
pawelgm
Thanks hughesjr, you might be onto something. If that indeed is that case I wonder how can I connect to port 22 that is also under 1024. Is port 22
let through by default ???
hughesjr
it is if you select allow ssh during install .... if you look at the /etc/sysconfig/iptables file, you may see a similar entry for port 22 already.

you can temporarily turn off the iptables (/etc/init.d/iptables stop) and then restart sshd to check it .... there may already be something like apache already using port 443 (as chrisw said) as well.

If you can't get it to work by turning off iptables and testing, stop sshd (/etc/init.d/sshd stop) and do the command:

netstat -an | grep LISTEN

and look for something listening on port 443 .... it would look like this:

tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
pawelgm
hughesjr u are truly a know-it-all. After I stopped the iptables the sshd did accept connections on 443. So i guess I must change the iptables set up. Thanks . I mean really thanks a lot ! U rule !!!
net2know
I am also new to Unix/Linux environment but, I would like to thanks to all of you for your postings. I was trying to use Port 443 as it was mention at the begining of the forum.

I change the /etc/init.d/iptable informaton adding a new line as mention by hughesjr which it hit it right on it. But still I was unable to connect to port 443, so I decided to reboot the box. After reboot the port was open.

Thank you all for you info. Because of you and the way you help one to each other I decided to become a member.

Very new to unix/linux, hope to learn from all of you.

laugh.gif biggrin.gif
hughesjr
Welcome aboard!

Thanks for using the search function to find the fix for your problem. smile.gif

If you have any problems that need answers, feel free to ask...if you know any answers, please post those too!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.