在CentOS7中安裝和配置ssh
發(fā)布日期:2022-01-31 00:58 | 文章來源:CSDN
1. 安裝openssh-server
yum install -y openssl openssh-server
2. 修改配置文件
用vim
打開配置文件/etc/ssh/sshd_config
將上圖的PermitRootLogin
,RSAAuthentication
,PubkeyAuthentication
的設置打開。
啟動ssh的服務:
systemctl start sshd.service
設置開機自動啟動ssh服務
systemctl enable sshd.service
設置文件夾~/.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
文件存儲的是客戶端的公共密鑰
。
以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持本站。
版權(quán)聲明:本站文章來源標注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務器上建立鏡像,否則將依法追究法律責任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學習參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。
相關(guān)文章