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

How to modify mysql to allow remote connections

Regarding the issue of MySQL remote connection, w...

Advanced Usage Examples of mv Command in Linux

Preface The mv command is the abbreviation of mov...

React error boundary component processing

This is the content of React 16. It is not the la...

Detailed explanation of JS ES6 variable destructuring assignment

Table of contents 1. What is deconstruction? 2. A...

Quickly solve the problem that the mysql57 service suddenly disappeared

one, G:\MySQL\MySQL Server 5.7\bin> mysqld --i...

JavaScript prototype and prototype chain details

Table of contents 1. prototype (explicit prototyp...

JavaScript to achieve full screen page scrolling effect

After I finished reading JavaScript DOM, I had a ...

Implementation steps for installing RocketMQ in docker

Table of contents 1. Retrieve the image 2. Create...

CentOS7.5 installation of MySQL8.0.19 tutorial detailed instructions

1. Introduction This article does not have screen...

Detailed explanation of CSS line-height and height

Recently, when I was working on CSS interfaces, I...

New settings for text and fonts in CSS3

Text Shadow text-shadow: horizontal offset vertic...

Example of how to generate random numbers and concatenate strings in MySQL

This article uses an example to describe how MySQ...

How to set the width and height of html table cells

When making web pages, you often encounter the pr...

In-depth understanding of HTML form input monitoring

Today I saw a blog post about input events, and o...