centos如何安裝ssh?

centos安裝ssh的方法:首先安裝【openssh-server】;然后修改配置文件,并啟動ssh的服務(wù);接著設(shè)置開機(jī)自動啟動;最后設(shè)置文件夾【~/.ssh】的訪問權(quán)限即可。

centos如何安裝ssh?

centos安裝ssh的方法:

1. 安裝openssh-server

yum?install?-y?openssl?openssh-server

2. 修改配置文件

用vim打開配置文件/etc/ssh/sshd_config

centos如何安裝ssh?

將上圖的PermitRootLogin,RSAAuthentication,PubkeyAuthentication的設(shè)置打開。

3、啟動ssh的服務(wù):

systemctl?start?sshd.service

4、設(shè)置開機(jī)自動啟動ssh服務(wù)

systemctl?enable?sshd.service

5、設(shè)置文件夾~/.ssh的訪問權(quán)限:

$?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文件存儲的是客戶端的公共密鑰。

相關(guān)教程推薦:centos教程

以上就是

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊12 分享