Home >Operation and Maintenance >CentOS >How to install ssh on centos?
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,
PubkeyAuthentication are turned on.
systemctl start sshd.service4. Set the ssh service to automatically start at boot
systemctl enable sshd.service5. 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:
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!