SSH (Secure Shell) installation in Redhat OS / CentOS

SSH is a program for logging into a remote machine and for executing commands on a remote machine. It provide secure encrypted communications between two untrusted hosts over an insecure network.

It connects and logs into the specified hostname.

 

Steps to install and configure ssh server:-

Step 1 :- Check for the openssh-server that it is already installed or not.

  • rpm -q openssh-server

Step 2 :- If it is not installed then install ssh by typing following command:-

  • yum install openssh-server

Step 3 :- The configuration files of the ssh is shown by the following command:-

  • rpm -qc openssh-server

The main cofiguration file is in /etc/ssh/sshd_config.

Step 4 :- Now restart the ssh daemon service by the following command:-

  • systemctl restart sshd
  • systemctl enable sshd
  • systemctl status sshd

 

Steps to install ssh client:-

Step 1 :- Install sshd client service by the following command:-

  • yum install openssh-clients

Step 2 :- Now restart the ssh client side daemon service by the following command:-

  • systemctl restart sshd
  • systemctl enable sshd
  • systemctl status sshd

Finally to connect client to server remotely with ssh, use following command:-

ssh user-name@xxx.xxx.xxx.xxx <== ip address of the server