Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to chnage my ssh port number on my server as i can see many attackes and failed login attempts onthat port

  1. How can i change that
  2. If i do that , what other places , servces i need to chnage or will be affected by it or will stop working. is anything linking on that port
share|improve this question

2 Answers 2

Modify this value in your /etc/ssh/sshd_config file:

Port 22

Then restart sshd.


That said, changing the port number is merely security by obscurity, which is not much security at all. Instead of doing this, set yourself up with key auth and then disable PasswordAuthentication in your sshd_config.

Number two depends on the service. Services ask for the port number to connect to and not many processes require SSH.

share|improve this answer
    
Answering number two, it depends on the service. Any services that you add usually ask for the port number if they connect using SSH (not normal). –  Gabriel Graves Mar 3 '13 at 3:49
    
@GabrielGraves I believe you meant to comment on the question, not my answer. –  EEAA Mar 3 '13 at 3:50
    
I just wanted to add to your question instead of creating one of my own as he asked two questions and you answered the first one perfectly and there's no reason to create a new answer and answer both. –  Gabriel Graves Mar 3 '13 at 3:51
    
Ok, fair enough. Feel free to edit my answer to include the other part. –  EEAA Mar 3 '13 at 3:57
1  
@user75380 you didn't mention having a firewall in place, so how was I supposed to divine that? You're the sysadmin here... –  EEAA Mar 3 '13 at 4:15

As the other answer states, this doesn't really solve anything. Besides the measures suggested there, consider installing denyhosts, it is part of the EPEL semi-official repositories.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.