title: Executing echo c >sysrq-trigger on remote machine in bash
body: <p>I am trying to do some automation in which following is the requirement :-</p>
  
  <p>"From machine A run command "echo c > /proc/sysrq-trigger" on machine B so that machine B crashes and after machine B boots up (post crash) do some other things like copying files from machine b to  machine A."</p>
  
  <p>For this purpose i tried the following 2 methods  :-</p>
  
  <ol>
  <li><p>"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root  "sh //proc/sysrq-trigger command>"</p></li>
  <li><p>"ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root  "sh  echo c >/proc/sysrq-trigger >"</p></li>
  </ol>
  
  <p>In both the cases password-less ssh is set or will provide password through expect. So password is not a problem here.The problem is the control gets stuck after executing sysrq instruction on the remote machine B. It does not come back on machine A so that i can perform any other operation on the same terminal.</p>
  
  <pre><code># ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -l root &lt;Machine B&gt; "echo c &gt; /proc/sysrq-trigger " 
  </code></pre>
  
  <p>Warning: Permanently added 'ca-ostest212.us.oracle.com,139.185.48.212' (RSA) to the list of known hosts.
  root@'s password:</p>
  
  <p>After providing password machine B crashes and reboots but prompt on machine A does not come back.Is there any method to solve this so that prompt comes back and next commands get executed on machine A.</p>
  
  <p>PS :- Apology for this lengthy query. Plz help. Thanks in advance.</p>