網站首頁 編程語言 正文
一、安裝
1.1、檢查ssh是否已經安裝
方式一
[root@localhost ~]# rpm -qa|grep ssh
方式二
[root@localhost ~]# ssh -version
1.2、使用yum進行安裝(必須可以連網)
- 查看一下和ssh相關的安裝包
[root@localhost ~]# yum search ssh
- 安裝openssh
[root@localhost ~]# yum install -y openssh-*
二、測試
2.1、配置ssh服務
- 備份原始配置文件
[root@localhost ~]# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.ori
- 修改配置文件
[root@localhost ~]# vim /etc/ssh/sshd_config
- 修改內容如下:
Port 52113
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#禁止root遠程登錄:
#LoginGraceTime 2m
PermitRootLogin no
#PermitRootLogin yes
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
#禁止DNS:
UseDNS no
#UseDNS yes
#不允許密碼登錄:
PermitEmptyPasswords no
#PermitEmptyPasswords no
- 檢查是否修改正確
[root@localhost ~]# vimdiff /etc/ssh/sshd_config.ori /etc/ssh/sshd_config
2.2、啟動SSH服務
- 啟動
[root@localhost ~]# service sshd start
或者
[root@localhost ~]# /etc/init.d/sshd start
- 有需要可以設置為開機啟動
[root@localhost ~]# chkconfig --level 35 sshd on
[root@localhost ~]# chkconfig --list sshd
原文鏈接:https://blog.csdn.net/shenxinde/article/details/124119911
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-09-12 shell腳本5種執行方式及腳本不同的執行方法和區別詳解_linux shell
- 2023-07-06 springBoot JWT實現websocket的token登錄攔截認證
- 2023-04-24 Python?相對路徑報錯:"No?such?file?or?directory"'原因及解決方法_
- 2022-10-29 python中正則表達式findall的用法實例_python
- 2022-09-16 C#數據庫操作的示例詳解_C#教程
- 2023-12-12 設置線程名稱(兩種方法)
- 2022-09-06 Python的functools模塊使用及說明_python
- 2022-03-22 C++名稱空間特性_C 語言
- 欄目分類
-
- 最近更新
-
- 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同步修改后的遠程分支