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

學無先后,達者為師

網站首頁 編程語言 正文

在CentOS7中安裝和配置ssh_Linux

作者:妖老山黑 ? 更新時間: 2022-03-12 編程語言

1. 安裝openssh-server

yum install -y openssl openssh-server

2. 修改配置文件

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

將上圖的PermitRootLoginRSAAuthentication,PubkeyAuthentication的設置打開。

啟動ssh的服務:

systemctl start sshd.service

設置開機自動啟動ssh服務

systemctl enable sshd.service

設置文件夾~/.ssh的訪問權限:

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

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

欄目分類
最近更新