這篇文章將為大家詳細(xì)講解有關(guān)如何進(jìn)行Linux服務(wù)器的ssh配置,文章內(nèi)容質(zhì)量較高,因此小編分享給大家做個參考,希望大家閱讀完這篇文章后對相關(guān)知識有一定的了解。

創(chuàng)新互聯(lián)公司是專業(yè)的桂林網(wǎng)站建設(shè)公司,桂林接單;提供做網(wǎng)站、
網(wǎng)站設(shè)計,網(wǎng)頁設(shè)計,網(wǎng)站設(shè)計,建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行桂林網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊,希望更多企業(yè)前來合作!
Ssh配置
通過配置文件,我們可以有效的管理ssh
1、空閑時間關(guān)閉連接
1)修改配置文件“/etc/ssh/sshd_config”,設(shè)置clientAliveInterval和clientAliveCountMax,注意取消前面的注釋
[root@localhost wj]#
gedit /etc/ssh/sshd_conf
ClientAliveInterval 10 // 超時時間, 10s
ClientAliveCountMax 0 // 超時次數(shù), 次
[root@localhost wj]#
service sshd restart // 重啟服務(wù)
停止
sshd : [ 確定 ]
正在啟動
sshd : [ 確定 ]
|
2)測試超時,登錄之后不要進(jìn)行任何操作,10s之后連接就會關(guān)閉
[root@localhost wj]#
ssh david@192.168.0.119
david@192.168.0.119's password:
Last login: Thu Aug 16 08:22:25 2018 from 192.168.0.119
already login
[david@localhost ~]$
Connection to 192.168.0.119 closed by remote host.
Connection to 192.168.0.119 closed.
[root@localhost wj]#
|
2、輸入密碼超時,關(guān)閉連接
1)修改配置文件“/etc/ssh/sshd_config”,設(shè)置參數(shù)“LoginGraceTime”
[root@localhost wj]#
gedit /etc/ssh/sshd_config
LoginGraceTime 10s // 這里默認(rèn)是 2m ,代表 2 分鐘。設(shè)置為 10s ,取消注釋
[root@localhost wj]#
service sshd restart // 重啟服務(wù)
停止
sshd : [ 確定 ]
正在啟動
sshd : [ 確定 ]
|
2)測試,登錄的時候不輸入密碼,連接會自動斷開
[root@localhost wj]# ssh david@192.168.0.119
david@192.168.0.119's password:
Connection closed by UNKNOWN
|
做了一個Linux學(xué)習(xí)的平臺,目前出來一個個形,各位可以參考使用
鏈接:https ://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ密碼:n7bk

關(guān)于如何進(jìn)行Linux服務(wù)器的ssh配置就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到。
網(wǎng)站欄目:如何進(jìn)行Linux服務(wù)器的ssh配置-創(chuàng)新互聯(lián)
標(biāo)題鏈接:
http://www.weahome.cn/article/doopco.html