Can someone let me know how can I reboot a remote server via Python ?
I tried the below command:-
os.system('sudo ssh -q -i /home/support/.ssh/id_rsa_vnera_cluster_keypair -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null support@a.b.c.d "sudo -S su ubuntu -c 'sudo reboot --force'"')
But my code was stuck in the above command waiting for the response as the reboot
command does not return anything.
- OS - Ubuntu 16.04
- Python 2.7.12