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:
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
PermitRootLogin in the above picture The settings for,
RSAAuthentication,
PubkeyAuthenticationare turned on.
systemctl start sshd.service
systemctl enable sshd.service
~/.sshAccess 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_keysThe file stores the client’s public key.
Recommended related tutorials:
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!