Install and configure ssh in CentOS7

Install and configure ssh in CentOS7

1. Install openssh-server

yum install -y openssl openssh-server

2. Modify the configuration file

Open the configuration file /etc/ssh/sshd_config with vim

Turn on the settings of PermitRootLogin , RSAAuthentication , and PubkeyAuthentication in the above figure.

Start the ssh service:

systemctl start sshd.service

Set the ssh service to start automatically at boot

systemctl enable sshd.service

Set the access permissions for the folder ~/.ssh:

$ cd ~
$ chmod 700 .ssh                                                                                                
$ chmod 600 .ssh/*                                                                                              
$ ls -la .ssh                                                                                                   
total 16
drwx------. 2 root root 58 May 15 00:23 .
dr-xr-x---. 8 root root 4096 May 15 00:26 ..
-rw------. 1 root root 403 May 15 00:22 authorized_keys
-rw------. 1 root root 1766 May 15 00:21 id_rsa
-rw------. 1 root root 403 May 15 00:21 id_rsa.pub

The authorized_keys file stores the client's公共密鑰.

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to install openssh from source code in centos 7
  • CentOS method to modify the default ssh port number example
  • How to add or modify SSH port number in CentOS7
  • How to modify the SSH login port in CentOS7

<<:  Summarize the commonly used nth-child selectors

>>:  The pitfall record of case when judging NULL value in MySQL

Recommend

Detailed explanation of Excel parsing and exporting based on Vue

Table of contents Preface Basic Introduction Code...

Small problem with the spacing between label and input in Google Browser

Code first, then text Copy code The code is as fol...

Implementation of HTML to PDF screenshot saving function

Using Technology itext.jar: Convert byte file inp...

How to install jupyter in docker on centos and open ports

Table of contents Install jupyter Docker port map...

Vue data responsiveness summary

Before talking about data responsiveness, we need...

Tutorial on installing MySQL 8.0.11 using RPM on Linux (CentOS7)

Table of contents 1. Installation preparation 1. ...

Linux uses lsof command to check file opening status

Preface We all know that in Linux, "everythi...

Vue project realizes login and registration effect

This article example shares the specific code of ...

js to call the network camera and handle common errors

Recently, due to business reasons, I need to acce...

JavaScript Dom implements the principle and example of carousel

If we want to make a carousel, we must first unde...

How to use Samba to build a shared file service on a Linux server

Recently, our small team needs to share a shared ...