Installing SSH server On CentOS

You need to install the following packages (which are installed by default until and unless you removed it or skipped it while installing CentOS)

  • openssh-clients : The OpenSSH client applications
  • openssh-server : The OpenSSH server daemon

 

OpenSSH Installations under CentOS Linux

To install the server and client type:

yum -y install openssh-server openssh-clients

Start the service:

chkconfig sshd on
service sshd start

Make sure port 22 is opened:

netstat -tulpn | grep :22

OpenSSH Server Configuration

Edit /etc/ssh/sshd_config, enter:

vi /etc/ssh/sshd_config

To disable root logins, edit or add as follows:

PermitRootLogin no

Restrict login to user tom and jerry only over ssh:

AllowUsers tom jerry

Change ssh port i.e. run it on a non-standard port like 1235

Port 1235

Save and close the file. Restart sshd:

service sshd restart

 

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.