日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

在CentOS7中安裝和配置ssh_Linux

作者:妖老山黑 ? 更新時(shí)間: 2022-03-12 編程語(yǔ)言

1. 安裝openssh-server

yum install -y openssl openssh-server

2. 修改配置文件

vim打開(kāi)配置文件/etc/ssh/sshd_config

將上圖的PermitRootLoginRSAAuthenticationPubkeyAuthentication的設(shè)置打開(kāi)。

啟動(dòng)ssh的服務(wù):

systemctl start sshd.service

設(shè)置開(kāi)機(jī)自動(dòng)啟動(dòng)ssh服務(wù)

systemctl enable sshd.service

設(shè)置文件夾~/.ssh的訪問(wèn)權(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文件存儲(chǔ)的是客戶端的公共密鑰

原文鏈接:https://www.cnblogs.com/liuhouhou/p/8975812.html

欄目分類(lèi)
最近更新