網站首頁 編程語言 正文
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的訪問權限:
$ 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
相關推薦
- 2022-11-07 SwiftUI?引導頁界面實現示例_Swift
- 2022-05-24 用BAT創建文件夾文件及回顯環境變量的問題_DOS/BAT
- 2022-07-13 FileInputStream與BufferedInputStream的區別
- 2022-09-25 創建的對象如何在堆區分配內存
- 2022-12-29 python中的多進程的創建與啟動方式_python
- 2022-06-09 詳解Python中*args和**kwargs的使用_python
- 2023-02-17 R語言繪制雙坐標圖的案例詳解_R語言
- 2022-09-16 淺析python中5個帶key的內置函數_python
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支