9.3.2 會(huì)話共享功能

2023-05-12 10:11 更新

screen命令不僅可以確保用戶在極端情況下也不丟失對(duì)系統(tǒng)的遠(yuǎn)程控制,保證了生產(chǎn)環(huán)境中遠(yuǎn)程工作的不間斷性,而且它還具有會(huì)話共享、分屏切割、會(huì)話鎖定等實(shí)用的功能。其中,會(huì)話共享功能是一件很酷的事情,當(dāng)多個(gè)用戶同時(shí)控制主機(jī)的時(shí)候,它可以把屏幕內(nèi)容共享出來,也就是說每個(gè)用戶都可以看到相同的內(nèi)容。

screen的會(huì)話共享功能的流程拓?fù)淙鐖D9-13所示。

圖9-13 會(huì)話共享功能的流程拓?fù)?/p>

要實(shí)現(xiàn)會(huì)話共享功能,首先使用ssh服務(wù)程序?qū)⒔K端A遠(yuǎn)程連接到服務(wù)器,并創(chuàng)建一個(gè)會(huì)話窗口。

    [root@client A ~]# ssh 192.168.10.10
    The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.
    ECDSA key fingerprint is 70:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.
    root@192.168.10.10's password:此處輸入root管理員密碼
    Last login: Wed May 4 07:56:29 2017
    [root@client A ~]# screen -S linuxprobe
    [root@client A ~]#

然后,使用ssh服務(wù)程序?qū)⒔K端B遠(yuǎn)程連接到服務(wù)器,并執(zhí)行獲取遠(yuǎn)程會(huì)話的命令。接下來,兩臺(tái)主機(jī)就能看到相同的內(nèi)容了。

    [root@client B ~]# ssh 192.168.10.10
    The authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.
    ECDSA key fingerprint is 70:3b:5d:37:96:7b:2e:a5:28:0d:7e:dc:47:6a:fe:5c.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.
    root@192.168.10.10's password:此處輸入root管理員密碼
    Last login: Wed Feb 22 04:55:38 2017 from 192.168.10.10
    [root@client B ~]# screen -x 
    [root@client B ~]
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)