How can I ssh into multiple password protected machines to reboot them?











up vote
-1
down vote

favorite












I'm trying to write a bash script to reboot multiple machines via ssh that are all password protected. I have all the IPs listed in a .txt file and want the script to read the IPs from there. I've been messing with the expect command since my mac does not have sshpass. Is there a way to do this without sshpass??



I have this so far:



#!/bin/bash

for server in 'testreboot.txt'; do
expect -c 'spawn ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
administrator@$server "sudo shutdown -r now"; expect "Password:"; send
"passwordr"; interact'
done


In testreboot.txt I simply have the IP address listed of a test machine. Is that ok or do I need to assign it to a variable? I keep getting a variable error when I try to run it.










share|improve this question









New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
    – Ben
    Nov 29 at 1:07










  • take a look at sexpect with which you can write Expect scripts with shell code only.
    – pynexj
    Nov 29 at 5:47















up vote
-1
down vote

favorite












I'm trying to write a bash script to reboot multiple machines via ssh that are all password protected. I have all the IPs listed in a .txt file and want the script to read the IPs from there. I've been messing with the expect command since my mac does not have sshpass. Is there a way to do this without sshpass??



I have this so far:



#!/bin/bash

for server in 'testreboot.txt'; do
expect -c 'spawn ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
administrator@$server "sudo shutdown -r now"; expect "Password:"; send
"passwordr"; interact'
done


In testreboot.txt I simply have the IP address listed of a test machine. Is that ok or do I need to assign it to a variable? I keep getting a variable error when I try to run it.










share|improve this question









New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
    – Ben
    Nov 29 at 1:07










  • take a look at sexpect with which you can write Expect scripts with shell code only.
    – pynexj
    Nov 29 at 5:47













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











I'm trying to write a bash script to reboot multiple machines via ssh that are all password protected. I have all the IPs listed in a .txt file and want the script to read the IPs from there. I've been messing with the expect command since my mac does not have sshpass. Is there a way to do this without sshpass??



I have this so far:



#!/bin/bash

for server in 'testreboot.txt'; do
expect -c 'spawn ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
administrator@$server "sudo shutdown -r now"; expect "Password:"; send
"passwordr"; interact'
done


In testreboot.txt I simply have the IP address listed of a test machine. Is that ok or do I need to assign it to a variable? I keep getting a variable error when I try to run it.










share|improve this question









New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I'm trying to write a bash script to reboot multiple machines via ssh that are all password protected. I have all the IPs listed in a .txt file and want the script to read the IPs from there. I've been messing with the expect command since my mac does not have sshpass. Is there a way to do this without sshpass??



I have this so far:



#!/bin/bash

for server in 'testreboot.txt'; do
expect -c 'spawn ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
administrator@$server "sudo shutdown -r now"; expect "Password:"; send
"passwordr"; interact'
done


In testreboot.txt I simply have the IP address listed of a test machine. Is that ok or do I need to assign it to a variable? I keep getting a variable error when I try to run it.







ssh reboot expect






share|improve this question









New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Nov 29 at 1:49









Rui F Ribeiro

38.3k1476127




38.3k1476127






New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Nov 29 at 0:43









Danny

6




6




New contributor




Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Danny is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
    – Ben
    Nov 29 at 1:07










  • take a look at sexpect with which you can write Expect scripts with shell code only.
    – pynexj
    Nov 29 at 5:47


















  • It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
    – Ben
    Nov 29 at 1:07










  • take a look at sexpect with which you can write Expect scripts with shell code only.
    – pynexj
    Nov 29 at 5:47
















It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
– Ben
Nov 29 at 1:07




It might be time to start looking into Python. I really like paramiko for this sort of work. Also consider Ansible
– Ben
Nov 29 at 1:07












take a look at sexpect with which you can write Expect scripts with shell code only.
– pynexj
Nov 29 at 5:47




take a look at sexpect with which you can write Expect scripts with shell code only.
– pynexj
Nov 29 at 5:47










2 Answers
2






active

oldest

votes

















up vote
2
down vote













You have single quoted the string; this prevents the shell from
interpolating $server. TCL (which is what expect code is written in)
also uses the $server form to interpolate variables, but you have not
set server ... anywhere in your TCL code. Hence the error, as the
shell did not interpolate it nor did the TCL set it. One method would be
to double quote the TCL expression which will allow the shell to
interpolate in the shell $server variable:



$ server=example; expect -c 'puts $server'
can't read "server": no such variable
while executing
"puts $server"
$ server=example; expect -c "puts $server"
example
$


However this will mean that any " in the TCL code will need to be
escaped to protect them from messing with the shell interpolation which
will probably get ugly real fast and will be hard to debug, especially
as the commands get longer and more complicated.



$ server=example; expect -c "puts "a server named '$server'""
a server named 'example'
$


Another option would be to read the argument into a TCL variable, but,
alas, the -c flag code of expect has no access to the arguments list
in char *argv as the -c code is run before the arguments list is
made available for use by TCL. Therefore to use $server as a TCL
variable the script would need to be rewritten in TCL:



#!/usr/bin/env expect

set fh [open testreboot.txt r]

while {[gets $fh server] >= 0} {
spawn -noecho ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
administrator@$server
expect -ex "Password:"
send "Hunter2r"
expect -ex {$ }
send "sudo shutdown -r nowr"
expect -ex "Password:"
send "Hunter2r"
interact
}


which will may need improvements for error handling, timeouts, matching
the shell prompt better, etc.






share|improve this answer




























    up vote
    1
    down vote













    It's not easy to embed Expect in shell scripts. I'd give you an example using the sexpect tool.



    The code:



    [STEP 101] # cat foo.xsh
    user=foo
    passwd=foobar
    while read host; do
    echo ==== $host ====
    export SEXPECT_SOCKFILE=~/tmp/host-$host-$$.sock

    sexpect spawn
    ssh -o StrictHostKeyChecking=no
    -o ConnectTimeout=5
    -o UserKnownHostsFile=/dev/null
    -t
    $user@$host bash --norc
    sexpect expect -i password:
    sexpect send -enter "$passwd"
    sexpect expect -re 'bash-[.0-9]+[#$] $'

    sexpect send -enter "sudo date"
    sexpect expect -i -re "password( for [^[:blank:]]+):"
    sexpect send -enter "$passwd"
    sexpect expect -re 'bash-[.0-9]+[#$] $'

    sexpect send -enter exit
    sexpect wait
    done < hosts-file


    Testing:



    [STEP 102] # cat hosts-file
    host1
    host2
    [STEP 103] # bash foo.xsh
    ==== host1 ====
    foo@host1's password:
    bash-4.4$ sudo date
    [sudo] password for foo:
    Thu Nov 29 14:28:39 CST 2018
    bash-4.4$ exit
    exit
    Connection to host1 closed.
    ==== host2 ====
    foo@host2's password:
    bash-4.4$ sudo date
    [sudo] password for foo:
    Thu Nov 29 14:28:40 CST 2018
    bash-4.4$ exit
    exit
    Connection to host2 closed.
    [STEP 104] #





    share|improve this answer








    New contributor




    pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


















      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });






      Danny is a new contributor. Be nice, and check out our Code of Conduct.










      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484801%2fhow-can-i-ssh-into-multiple-password-protected-machines-to-reboot-them%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      You have single quoted the string; this prevents the shell from
      interpolating $server. TCL (which is what expect code is written in)
      also uses the $server form to interpolate variables, but you have not
      set server ... anywhere in your TCL code. Hence the error, as the
      shell did not interpolate it nor did the TCL set it. One method would be
      to double quote the TCL expression which will allow the shell to
      interpolate in the shell $server variable:



      $ server=example; expect -c 'puts $server'
      can't read "server": no such variable
      while executing
      "puts $server"
      $ server=example; expect -c "puts $server"
      example
      $


      However this will mean that any " in the TCL code will need to be
      escaped to protect them from messing with the shell interpolation which
      will probably get ugly real fast and will be hard to debug, especially
      as the commands get longer and more complicated.



      $ server=example; expect -c "puts "a server named '$server'""
      a server named 'example'
      $


      Another option would be to read the argument into a TCL variable, but,
      alas, the -c flag code of expect has no access to the arguments list
      in char *argv as the -c code is run before the arguments list is
      made available for use by TCL. Therefore to use $server as a TCL
      variable the script would need to be rewritten in TCL:



      #!/usr/bin/env expect

      set fh [open testreboot.txt r]

      while {[gets $fh server] >= 0} {
      spawn -noecho ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
      administrator@$server
      expect -ex "Password:"
      send "Hunter2r"
      expect -ex {$ }
      send "sudo shutdown -r nowr"
      expect -ex "Password:"
      send "Hunter2r"
      interact
      }


      which will may need improvements for error handling, timeouts, matching
      the shell prompt better, etc.






      share|improve this answer

























        up vote
        2
        down vote













        You have single quoted the string; this prevents the shell from
        interpolating $server. TCL (which is what expect code is written in)
        also uses the $server form to interpolate variables, but you have not
        set server ... anywhere in your TCL code. Hence the error, as the
        shell did not interpolate it nor did the TCL set it. One method would be
        to double quote the TCL expression which will allow the shell to
        interpolate in the shell $server variable:



        $ server=example; expect -c 'puts $server'
        can't read "server": no such variable
        while executing
        "puts $server"
        $ server=example; expect -c "puts $server"
        example
        $


        However this will mean that any " in the TCL code will need to be
        escaped to protect them from messing with the shell interpolation which
        will probably get ugly real fast and will be hard to debug, especially
        as the commands get longer and more complicated.



        $ server=example; expect -c "puts "a server named '$server'""
        a server named 'example'
        $


        Another option would be to read the argument into a TCL variable, but,
        alas, the -c flag code of expect has no access to the arguments list
        in char *argv as the -c code is run before the arguments list is
        made available for use by TCL. Therefore to use $server as a TCL
        variable the script would need to be rewritten in TCL:



        #!/usr/bin/env expect

        set fh [open testreboot.txt r]

        while {[gets $fh server] >= 0} {
        spawn -noecho ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
        administrator@$server
        expect -ex "Password:"
        send "Hunter2r"
        expect -ex {$ }
        send "sudo shutdown -r nowr"
        expect -ex "Password:"
        send "Hunter2r"
        interact
        }


        which will may need improvements for error handling, timeouts, matching
        the shell prompt better, etc.






        share|improve this answer























          up vote
          2
          down vote










          up vote
          2
          down vote









          You have single quoted the string; this prevents the shell from
          interpolating $server. TCL (which is what expect code is written in)
          also uses the $server form to interpolate variables, but you have not
          set server ... anywhere in your TCL code. Hence the error, as the
          shell did not interpolate it nor did the TCL set it. One method would be
          to double quote the TCL expression which will allow the shell to
          interpolate in the shell $server variable:



          $ server=example; expect -c 'puts $server'
          can't read "server": no such variable
          while executing
          "puts $server"
          $ server=example; expect -c "puts $server"
          example
          $


          However this will mean that any " in the TCL code will need to be
          escaped to protect them from messing with the shell interpolation which
          will probably get ugly real fast and will be hard to debug, especially
          as the commands get longer and more complicated.



          $ server=example; expect -c "puts "a server named '$server'""
          a server named 'example'
          $


          Another option would be to read the argument into a TCL variable, but,
          alas, the -c flag code of expect has no access to the arguments list
          in char *argv as the -c code is run before the arguments list is
          made available for use by TCL. Therefore to use $server as a TCL
          variable the script would need to be rewritten in TCL:



          #!/usr/bin/env expect

          set fh [open testreboot.txt r]

          while {[gets $fh server] >= 0} {
          spawn -noecho ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
          administrator@$server
          expect -ex "Password:"
          send "Hunter2r"
          expect -ex {$ }
          send "sudo shutdown -r nowr"
          expect -ex "Password:"
          send "Hunter2r"
          interact
          }


          which will may need improvements for error handling, timeouts, matching
          the shell prompt better, etc.






          share|improve this answer












          You have single quoted the string; this prevents the shell from
          interpolating $server. TCL (which is what expect code is written in)
          also uses the $server form to interpolate variables, but you have not
          set server ... anywhere in your TCL code. Hence the error, as the
          shell did not interpolate it nor did the TCL set it. One method would be
          to double quote the TCL expression which will allow the shell to
          interpolate in the shell $server variable:



          $ server=example; expect -c 'puts $server'
          can't read "server": no such variable
          while executing
          "puts $server"
          $ server=example; expect -c "puts $server"
          example
          $


          However this will mean that any " in the TCL code will need to be
          escaped to protect them from messing with the shell interpolation which
          will probably get ugly real fast and will be hard to debug, especially
          as the commands get longer and more complicated.



          $ server=example; expect -c "puts "a server named '$server'""
          a server named 'example'
          $


          Another option would be to read the argument into a TCL variable, but,
          alas, the -c flag code of expect has no access to the arguments list
          in char *argv as the -c code is run before the arguments list is
          made available for use by TCL. Therefore to use $server as a TCL
          variable the script would need to be rewritten in TCL:



          #!/usr/bin/env expect

          set fh [open testreboot.txt r]

          while {[gets $fh server] >= 0} {
          spawn -noecho ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5
          administrator@$server
          expect -ex "Password:"
          send "Hunter2r"
          expect -ex {$ }
          send "sudo shutdown -r nowr"
          expect -ex "Password:"
          send "Hunter2r"
          interact
          }


          which will may need improvements for error handling, timeouts, matching
          the shell prompt better, etc.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 29 at 1:26









          thrig

          23.8k12955




          23.8k12955
























              up vote
              1
              down vote













              It's not easy to embed Expect in shell scripts. I'd give you an example using the sexpect tool.



              The code:



              [STEP 101] # cat foo.xsh
              user=foo
              passwd=foobar
              while read host; do
              echo ==== $host ====
              export SEXPECT_SOCKFILE=~/tmp/host-$host-$$.sock

              sexpect spawn
              ssh -o StrictHostKeyChecking=no
              -o ConnectTimeout=5
              -o UserKnownHostsFile=/dev/null
              -t
              $user@$host bash --norc
              sexpect expect -i password:
              sexpect send -enter "$passwd"
              sexpect expect -re 'bash-[.0-9]+[#$] $'

              sexpect send -enter "sudo date"
              sexpect expect -i -re "password( for [^[:blank:]]+):"
              sexpect send -enter "$passwd"
              sexpect expect -re 'bash-[.0-9]+[#$] $'

              sexpect send -enter exit
              sexpect wait
              done < hosts-file


              Testing:



              [STEP 102] # cat hosts-file
              host1
              host2
              [STEP 103] # bash foo.xsh
              ==== host1 ====
              foo@host1's password:
              bash-4.4$ sudo date
              [sudo] password for foo:
              Thu Nov 29 14:28:39 CST 2018
              bash-4.4$ exit
              exit
              Connection to host1 closed.
              ==== host2 ====
              foo@host2's password:
              bash-4.4$ sudo date
              [sudo] password for foo:
              Thu Nov 29 14:28:40 CST 2018
              bash-4.4$ exit
              exit
              Connection to host2 closed.
              [STEP 104] #





              share|improve this answer








              New contributor




              pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                up vote
                1
                down vote













                It's not easy to embed Expect in shell scripts. I'd give you an example using the sexpect tool.



                The code:



                [STEP 101] # cat foo.xsh
                user=foo
                passwd=foobar
                while read host; do
                echo ==== $host ====
                export SEXPECT_SOCKFILE=~/tmp/host-$host-$$.sock

                sexpect spawn
                ssh -o StrictHostKeyChecking=no
                -o ConnectTimeout=5
                -o UserKnownHostsFile=/dev/null
                -t
                $user@$host bash --norc
                sexpect expect -i password:
                sexpect send -enter "$passwd"
                sexpect expect -re 'bash-[.0-9]+[#$] $'

                sexpect send -enter "sudo date"
                sexpect expect -i -re "password( for [^[:blank:]]+):"
                sexpect send -enter "$passwd"
                sexpect expect -re 'bash-[.0-9]+[#$] $'

                sexpect send -enter exit
                sexpect wait
                done < hosts-file


                Testing:



                [STEP 102] # cat hosts-file
                host1
                host2
                [STEP 103] # bash foo.xsh
                ==== host1 ====
                foo@host1's password:
                bash-4.4$ sudo date
                [sudo] password for foo:
                Thu Nov 29 14:28:39 CST 2018
                bash-4.4$ exit
                exit
                Connection to host1 closed.
                ==== host2 ====
                foo@host2's password:
                bash-4.4$ sudo date
                [sudo] password for foo:
                Thu Nov 29 14:28:40 CST 2018
                bash-4.4$ exit
                exit
                Connection to host2 closed.
                [STEP 104] #





                share|improve this answer








                New contributor




                pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  It's not easy to embed Expect in shell scripts. I'd give you an example using the sexpect tool.



                  The code:



                  [STEP 101] # cat foo.xsh
                  user=foo
                  passwd=foobar
                  while read host; do
                  echo ==== $host ====
                  export SEXPECT_SOCKFILE=~/tmp/host-$host-$$.sock

                  sexpect spawn
                  ssh -o StrictHostKeyChecking=no
                  -o ConnectTimeout=5
                  -o UserKnownHostsFile=/dev/null
                  -t
                  $user@$host bash --norc
                  sexpect expect -i password:
                  sexpect send -enter "$passwd"
                  sexpect expect -re 'bash-[.0-9]+[#$] $'

                  sexpect send -enter "sudo date"
                  sexpect expect -i -re "password( for [^[:blank:]]+):"
                  sexpect send -enter "$passwd"
                  sexpect expect -re 'bash-[.0-9]+[#$] $'

                  sexpect send -enter exit
                  sexpect wait
                  done < hosts-file


                  Testing:



                  [STEP 102] # cat hosts-file
                  host1
                  host2
                  [STEP 103] # bash foo.xsh
                  ==== host1 ====
                  foo@host1's password:
                  bash-4.4$ sudo date
                  [sudo] password for foo:
                  Thu Nov 29 14:28:39 CST 2018
                  bash-4.4$ exit
                  exit
                  Connection to host1 closed.
                  ==== host2 ====
                  foo@host2's password:
                  bash-4.4$ sudo date
                  [sudo] password for foo:
                  Thu Nov 29 14:28:40 CST 2018
                  bash-4.4$ exit
                  exit
                  Connection to host2 closed.
                  [STEP 104] #





                  share|improve this answer








                  New contributor




                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  It's not easy to embed Expect in shell scripts. I'd give you an example using the sexpect tool.



                  The code:



                  [STEP 101] # cat foo.xsh
                  user=foo
                  passwd=foobar
                  while read host; do
                  echo ==== $host ====
                  export SEXPECT_SOCKFILE=~/tmp/host-$host-$$.sock

                  sexpect spawn
                  ssh -o StrictHostKeyChecking=no
                  -o ConnectTimeout=5
                  -o UserKnownHostsFile=/dev/null
                  -t
                  $user@$host bash --norc
                  sexpect expect -i password:
                  sexpect send -enter "$passwd"
                  sexpect expect -re 'bash-[.0-9]+[#$] $'

                  sexpect send -enter "sudo date"
                  sexpect expect -i -re "password( for [^[:blank:]]+):"
                  sexpect send -enter "$passwd"
                  sexpect expect -re 'bash-[.0-9]+[#$] $'

                  sexpect send -enter exit
                  sexpect wait
                  done < hosts-file


                  Testing:



                  [STEP 102] # cat hosts-file
                  host1
                  host2
                  [STEP 103] # bash foo.xsh
                  ==== host1 ====
                  foo@host1's password:
                  bash-4.4$ sudo date
                  [sudo] password for foo:
                  Thu Nov 29 14:28:39 CST 2018
                  bash-4.4$ exit
                  exit
                  Connection to host1 closed.
                  ==== host2 ====
                  foo@host2's password:
                  bash-4.4$ sudo date
                  [sudo] password for foo:
                  Thu Nov 29 14:28:40 CST 2018
                  bash-4.4$ exit
                  exit
                  Connection to host2 closed.
                  [STEP 104] #






                  share|improve this answer








                  New contributor




                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer






                  New contributor




                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Nov 29 at 6:31









                  pynexj

                  1117




                  1117




                  New contributor




                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  pynexj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






















                      Danny is a new contributor. Be nice, and check out our Code of Conduct.










                      draft saved

                      draft discarded


















                      Danny is a new contributor. Be nice, and check out our Code of Conduct.













                      Danny is a new contributor. Be nice, and check out our Code of Conduct.












                      Danny is a new contributor. Be nice, and check out our Code of Conduct.
















                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.





                      Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                      Please pay close attention to the following guidance:


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f484801%2fhow-can-i-ssh-into-multiple-password-protected-machines-to-reboot-them%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Accessing regular linux commands in Huawei's Dopra Linux

                      Can't connect RFCOMM socket: Host is down

                      Kernel panic - not syncing: Fatal Exception in Interrupt