五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

Linux下SSH Session復(fù)制功能實(shí)現(xiàn)方法

發(fā)布日期:2022-03-22 18:08 | 文章來源:CSDN

特別感謝阿干同學(xué)的郵件分享。

詳細(xì)方法


復(fù)制代碼
代碼如下:

Linux/mac下,在$HOME/.ssh/config中加入
Host *
ControlMaster auto
ControlPath <a>/tmp/ssh-%r@%h</a>

至此只要第一次SSH登錄輸入密碼,之后同個Hosts則免登。

配置文件分析

man ssh_config 5


復(fù)制代碼
代碼如下:

ControlPath
Specify the path to the control socket used for connection sharing as described in the ControlMaster section
above or the string “none” to disable connection sharing. In the path, ‘%l’ will be substituted by the
local host name, ‘%h’ will be substituted by the target host name, ‘%p’ the port, and ‘%r’ by the remote
login username. It is recommended that any ControlPath used for opportunistic connection sharing include at
least %h, %p, and %r. This ensures that shared connections are uniquely identified.

%r 為遠(yuǎn)程機(jī)器的登錄名
%h 為遠(yuǎn)程機(jī)器名

原理分析

嚴(yán)格地講,它并不是真正意義上的Session Copy,而只能說是共享Socket。
第一次登錄的時候,將Socket以文件的形式保存到:/tmp/ssh-%r@%h這個路徑
之后登錄的時候,一旦發(fā)現(xiàn)是同個主機(jī),則復(fù)用這個Socket
故,一旦主進(jìn)程強(qiáng)制退出(Ctrl+C),則其他SSH則被迫退出。

可以通過ssh -v參數(shù),看debug信息驗(yàn)證以上過程

備注

有同學(xué)說在linux上通過證書的形式,可以實(shí)現(xiàn)免登錄,沒錯。
對于靜態(tài)密碼,完全可以這么干;對于動態(tài)密碼(口令的方式),則上述手段可以方便很多。

香港穩(wěn)定服務(wù)器

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實(shí)時開通

自選配置、實(shí)時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部