How to install ssh on centos?

coldplay.xixi
Release: 2020-07-28 11:45:15
Original
19810 people have browsed it

How to install ssh in centos: first install [openssh-server]; then modify the configuration file and start the ssh service; then set up automatic startup at boot; finally set the access permissions of the folder [~/.ssh] That’s it.

How to install ssh on centos?

How to install ssh on centos:

1. Install openssh-server

yum install -y openssl openssh-server
Copy after login

2 . Modify the configuration file

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

How to install ssh on centos?

##Change the

PermitRootLogin in the above picture The settings for , RSAAuthentication, PubkeyAuthentication are turned on.

3. Start the ssh service:

systemctl start sshd.service
Copy after login

4. Set the ssh service to automatically start at boot

systemctl enable sshd.service
Copy after login

5. Set the folder

~/.ssh Access permissions:

$ 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
Copy after login

authorized_keys The file stores the client’s public key.

Recommended related tutorials:

centos tutorial

The above is the detailed content of How to install ssh on centos?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template