Home  >  Article  >  Operation and Maintenance  >  How to install ssh on centos?

How to install ssh on centos?

coldplay.xixi
coldplay.xixiOriginal
2020-07-28 11:45:1519583browse

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

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

4. Set the ssh service to automatically start at boot

systemctl enable sshd.service

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

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!

Statement:
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