Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to change my SSH port running Linux CentOS 6.

From what I've read on forums, people recommend changing my /etc/ssh/sshd_config file to use a different port number, then restarting the SSHD service.

I also noticed there's a ssh_config file along with sshD_config. What's the difference between the two? Should I change both?

share|improve this question

migrated from Dec 22 '11 at 17:21

This question came from our site for pro webmasters.

up vote 8 down vote accepted

The sshd_config is the ssh daemon (or ssh server process) configuration file. As you've already stated, this is the file you'll need to modify to change the server port.

Whereas, the ssh_config file is the ssh client configuration file. The client configuration file only has bearing on when you use the ssh command to connect to another ssh host. So, in this case, you don't need to modify it. It will be other client machines connecting to your server.

share|improve this answer
well said. thanks! – RCNeil Dec 22 '11 at 16:06

Your Answer


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.