Installing SSH server in Linux

Linux operation system comes packed with OpenSSH client and server as follows from OpenBSD project.

ssh - SSH client act as remote login program.

sshd - SSH server (Daemon) act as server which provide secure encrypted communications between two untrusted hosts over an insecure network. sshd listens for connections from clients (default ssh tcp port # 22). It is normally started at boot from /etc/init.d/ssh or /etc/init.d/sshd script. It forks a new daemon for each incoming connection. The forked daemons handle key exchange, encryption, authentication, command execution, and data exchange.

How do I install ssh under RHEL / SL (Scientific Linux) / CentOS / Fedora Linux?

Type the following yum command to install ssh client and server:

# yum -y install openssh-server openssh-clients

Start and enable sshd server:

# chkconfig sshd on
# service sshd start

Open port 22 for all IP address, enter:

# /sbin/iptable -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
# service iptables save

You can set an appropriate network block/mask, representing the machines on your network which must be allowed to access this SSH server. In this example open port 22 to only subnet

# /sbin/iptables -A INPUT -s -m state --state NEW -p tcp --dport 22 -j ACCEPT
# service iptables save

To configure OpenSSH server edit /etc/ssh/sshd config file.

$ man 5 sshd_config


Tags: , , , , , , ,

Comments & Responses

Leave a Reply

Your email address will not be published. Required fields are marked *


6 × = 36

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>