What is the difference between ssh_config and sshd_config

When you work on a Linux system, you play with SSH program on daily basis. You will be required to configure ssh client or ssh daemon on your Linux box to make it work properly. In each Linux distribution (Debian, Redhat and so on), there are two configuration files ssh_config and sshd_config for SSH program. What is the difference between ssh_config and sshd_config?

ssh_config: configuration file for the ssh client on the host machine you are running. For example, if you want to ssh to another remote host machine, you use a SSH client. Every settings for this SSH client will be using ssh_config, such as port number, protocol version and encryption/MAC algorithms.

sshd_config: configuration file for the sshd daemon (the program that listens to any incoming connection request to the ssh port) on the host machine. That is to say, if someone wants to connect to your host machine via SSH, their SSH client settings must match your sshd_config settings in order to communicate with you, such as port number, version and so on.

For example, most times we change the SSH port number for security reason. Take an example as follows:

For the SSH port number, ssh_config is manually set to be 1000 (decided by the remote host), sshd_config is set to be 5555. If anyone wants to connect to your host, they MUST set their ssh client port always to 1000. However, you will always use port 5555 as the default port (instead of the 22) to connect to a remote machine. If the remote machine uses another port or the standard port, you need to specify the port number in the command line, e.g., “ssh -p 22 remote.host.ip”

Hi All, I like to spend time on black and white screen with linux. I love to learn new things in linux specially in virtualization. Currently I am working on OpenStack like to dig deep.

Posted in Linux
One comment on “What is the difference between ssh_config and sshd_config
  1. sistemas says:

    Great post, helped me a lot

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: