0
我想實現的是重啓幾臺遠程服務器,而不必單獨登錄每臺服務器。 所以我消除了以下情況,希望它跳到服務器93,95和97上並重新啓動。如何在單個CLI命令中通過ssh重啓幾臺遠程機器
[[email protected]<home_server> ~]# seq 93 2 97 |xargs -I{} ssh <remoteservernumber_>{} "hostname; reboot"
The authenticity of host '<remoteservernumber_93 (IP.IP.IP.IP)' can't be established.
RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'remoteservernumber_93 (IP.IP.IP.IP)' (RSA) to the list of known hosts.
[email protected]_93's password:
remoteservernumber_93
Connection to remoteservernumber_93 closed by remote host.
xargs: ssh: exited with status 255; aborting
但是,我最終得到的是,當第一臺服務器重新啓動它終止連接,它不會跳到下一臺服務器。我究竟做錯了什麼?
您可以通過SSH以root身份登錄。大哎喲。永遠不要允許。 – Seb
絕對正確,你是。如果這是一個公共網絡,我不會。幸運的是,這遠離公共領域,我現在可以用這個設置。但問題仍然存在,我的邏輯在哪裏失敗? –