Hello, Due to recent attacks, I decided to change my ssh port. How can I do that as well as diabling the default 22 port' I changed port in my /etc/ssh/sshd_config , sshd_conf , ssh_conf files but still I am able to connect with port 22 Is something wrong I am doing? Please help. Thanks in advance.....
That's strange. I had to do this on my server once. This is the file that needed to be modified. /etc/ssh/sshd.conf you then need to restart SSH by typing this in your terminal /etc/init.d/sshd restart I'm not sure what version of linux you're running though. I have redhat linux on my server.
nano /etc/xinetd.d/sshd service ssh { disable = no socket_type = stream type = UNLISTED port = 22 protocol = tcp wait = no user = root server = /usr/sbin/sshd server_args = -i } Code (markup): Change "port = 22" for the new port and restart. with this command or control panel service sshd reload Code (markup):
u edited this file rite /etc/ssh/sshd.conf after that did u restart the server ??? if ur having bruce force attacks on your ssh server install this http://www.csc.liv.ac.uk/~greg/sshdfilter/ it will ban the attacks
Hello guys Just I noticed I solved the problem. I was needed to remove only a # freom the file....I am so stupid Thanks to all who helped
FOr others who want to change the ssh port: Open your /etc/sshd_config file You'll find a line saying # Port 22 Code (markup): Replace it with Port xxxxx Code (markup): Notice the "#" which is not present in the second code... Now restart the server. Also, make sure that the port doesnt conflicta with any other port used by your system. Post here if you hae any other problem
I came across this tutorial for CentOS also that people might find useful. http://fosswire.com/2006/11/27/quick-tutorial-secure-remote-login-to-your-system-with-ssh/
hey guyz am having problems... am SSHing into my server using Putty i needed to get there using an alternate port then 22, am running CentOs i did wat u recommended above, and even after the restart, i cant SSH but still on port 22, knowing that there is no more port 22 in the sshd_config $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options change a # default value. Port 2222 Port 587 Port 113 Port 465 and i restart... nothng... any help pls ?
If you want to change port 2222 then open /etc/ssh/sshd_config and chenge Port 2222 /etc/init.d/sshd restart