Install And Configure SSH On CentOS/Linux
install ssh in Centos

Install And Configure SSH On CentOS/Linux

install ssh centos: Encrypted communication takes place between the server and the client via the Secure Shell (SSH) protocol.

this is The best way is to send some sensitive and important information between the server and the client. because it uses the high protected protocol to send and receive data.

In this article, we will know in detail what is the ssh server and how can install and configure in our server.

install SSH Package

First of all, the package of ssh is already installed in every centos and Linux system, if you want to confirm that the package of ssh is installed in your system or not, then you can know the status of the package with the following command.

[root@simi ~] # yum list –installed | grep ssh

Check SSH Packages Install or not in CentOS 8

If the package of ssh server is not installed in your system then you can install the package with the following command.

#dnf install openssh

Install SSH Package in Centos8

Start and check ssh service status

After the ssh server package is successfully installed in the system, then start the service.

#systemctl start sshd

If ssh service starts successfully without any error then you can also check the status of its service.

If the service of your ssh server starts successfully and there is no error and you want to confirm the service run the following command, the massage of active (running) will show in your terminal screen as output as if you can see in the screen below .

OpenSSH Server Configuration

To configure ssh server first you edit the main configuration file of the server from where you can set the server’s port number, permission to login to the root user account, limiting access to other users, etc.

If you want to disable the root user which is the superuser account in the Linux, so that you do not want to access the ssh server from any client machine, then you can do the following steps.

Open the ssh Configuration file with the help of any text editor /etc/ssh/sshd_config and go to Near Line number 46 and change PermitRootLogin = yes to PermitRootLogin =no

Main Configuration File of SSH Server

[root@simi ~]# vim /etc/ssh/sshd_config

PermitRootLogin = yes chnage to this PermitRootLogin = no

SSH Server configuration File

Configure Firewall

If the firewall service is turned on in your system, then you have to allow the service of ssh from the firewall, for that you will have to run the following command.

IF firewall Service Running on SSH Server , Allow SSH

Access SSH Server From Windows Client Through Putty:

Putty Is a free open source Terminal emulator Software that runs on Windows as well as Linux, Unix, Ubuntu etc.

First, download and install the Putty software from the Internet. Download putty from the bellow link. https://www.putty.org/

open the Putty software and input the hostname or IP address on the hostname field and Click On Open Button to Connect SSH Server.

Connect Putty From Windows Computer to SSH Server

Enter Username and Password for Login SSH Server .

CentOS 8 Terminal

Connect SSH Server from Linux/Centos client System :

If you want to access the ssh server from another Linux or centos client machine then first of all you have to install the package of openssh-clients in the client system, it is very easy to install it. You can see the process below.

# yum -y openssh-clients

# ssh username @ hostname or IP address

[root@simi ~ ]# ssh simi@192.168.43.74

Send And Recieve file And Directory via Winscp

In these tutorials, we Learn About how to send and receive files and directories through WinScp.

First, download and install the WinScp software from the Internet. Download WinSCP Software from this link. https://winscp.net/eng/index.php

open the Winscp software and input the hostname or IP address on the hostname field, username, and also fill in the username and password Click On Login Button to Connect SSH Server.

Access SSH Server Via WinScp

Click On Yes Button for stablish the connection between server to client

add ssh host key to a cashe

After Successful Authentication you can Transfer and Receive file from server to client and client to server by drag and drop .

windows Terminal through WinScp

In this article, we have discussed install ssh centos and hope that from this article you will have got a lot of information related to ssh Server. If there are any doubts related to this article, then you can comment or send us your suggestions by comment


Rate this post