溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

Linux如何實(shí)現(xiàn)遠(yuǎn)程控制

發(fā)布時(shí)間:2022-02-19 09:41:29 來(lái)源:億速云 閱讀:363 作者:小新 欄目:開(kāi)發(fā)技術(shù)

小編給大家分享一下Linux如何實(shí)現(xiàn)遠(yuǎn)程控制,相信大部分人都還不怎么了解,因此分享這篇文章給大家參考一下,希望大家閱讀完這篇文章后大有收獲,下面讓我們一起去了解一下吧!

Linux一般作為服務(wù)器使用,而服務(wù)器一般放在機(jī)房,你不可能在機(jī)房操作你的Linux服務(wù)器這時(shí)我們就需要遠(yuǎn)程登錄到Linux服務(wù)器來(lái)管理維護(hù)系統(tǒng)。

Linux如何實(shí)現(xiàn)遠(yuǎn)程控制

從192.168.10.5這臺(tái)機(jī)登錄到192.168.10.16這臺(tái)機(jī)上,可以在192.168.10.16做一些操作,比如拷貝文件。

192.168.10.5

[root@localhost ~]# cd /tmp[root@localhost tmp]# ifconfigens32: flags=4163  mtu 1500
       inet 192.168.10.5  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe84:eae5  prefixlen 64  scopeid 0x20
       ether 00:0c:29:84:ea:e5  txqueuelen 1000  (Ethernet)
       RX packets 113798033  bytes 13848840312 (12.8 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 89922573  bytes 134234526128 (125.0 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 168  bytes 14260 (13.9 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 168  bytes 14260 (13.9 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# ls[root@localhost tmp]# pwd/tmp

192.168.10.16

[root@localhost ~]# cd /tmp[root@localhost tmp]# ifconfigens32: flags=4163  mtu 1500
       inet 192.168.10.16  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe62:fcc4  prefixlen 64  scopeid 0x20
       ether 00:0c:29:62:fc:c4  txqueuelen 1000  (Ethernet)
       RX packets 20886  bytes 7480105 (7.1 MiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 10471  bytes 7083155 (6.7 MiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 580  bytes 49312 (48.1 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 580  bytes 49312 (48.1 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# lsPHP.gif  test  timestamp.txt  程序員等級(jí)判別.jpg  背鍋.gif  重啟.jpg
[root@localhost tmp]# pwd/tmp

從192.168.10.5登錄到192.168.10.16

[root@localhost tmp]# ssh root@192.168.10.16root@192.168.10.16's password:
Last login: Wed Jun 19 22:12:56 2019 from 192.168.10.5
[root@localhost ~]# ifconfig
ens32: flags=4163  mtu 1500
       inet 192.168.10.16  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe62:fcc4  prefixlen 64  scopeid 0x20
       ether 00:0c:29:62:fc:c4  txqueuelen 1000  (Ethernet)
       RX packets 21050  bytes 7495118 (7.1 MiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 10554  bytes 7095520 (6.7 MiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 580  bytes 49312 (48.1 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 580  bytes 49312 (48.1 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

從192.168.10.16拷貝文件到192.168.10.5

[root@localhost ~]# cd /tmp[root@localhost tmp]# lsPHP.gif  test  timestamp.txt  程序員等級(jí)判別.jpg  背鍋.gif  重啟.jpg
[root@localhost tmp]# scp 程序員等級(jí)判別.jpg root@192.168.10.5:/tmpThe authenticity of host '192.168.10.5 (192.168.10.5)' can't be established.
ECDSA key fingerprint is 60:aa:a7:f2:b2:bb:24:d4:31:50:2a:4f:50:82:e0:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.10.5' (ECDSA) to the list of known hosts.
root@192.168.10.5's password:
程序員等級(jí)判別.jpg                                100%   12KB  12.1KB/s   00:00    
[root@localhost tmp]# exit #退出遠(yuǎn)程登錄logoutConnection to 192.168.10.16 closed.
[root@localhost tmp]# ifconfig #確認(rèn)已經(jīng)回到192.168.10.5ens32: flags=4163  mtu 1500
       inet 192.168.10.5  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe84:eae5  prefixlen 64  scopeid 0x20
       ether 00:0c:29:84:ea:e5  txqueuelen 1000  (Ethernet)
       RX packets 113798588  bytes 13848904758 (12.8 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 89923000  bytes 134234574328 (125.0 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 168  bytes 14260 (13.9 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 168  bytes 14260 (13.9 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# ls#已經(jīng)成功從192.168.10.16拷貝文件到192.168.10.5程序員等級(jí)判別.jpg

以上是“Linux如何實(shí)現(xiàn)遠(yuǎn)程控制”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI