zydcom :
shell\n\nreboot\n\n\npython\n\nimport os\nos.system('reboot')\n\n\nNote: You need root permission to do reboot operation.\n\nYou should take some time to learn Linux basic concepts first.",
2016-02-22T06:02:55
Julien JEHL :
You need two things to make your linux system to reboot.\n\n1 - Give the user executing your script the privilege for reboot\n\n$ sudo visudo -f /etc/sudoers.d/reboot_privilege\n\nadd line :\n\n<user> ALL=(root) NOPASSWD: /sbin/reboot\n\n2 - Execute the python code :\n\nimport os\nos.system(\"sudo reboot\")\n\n\nIt will reboot your system without any prompt nor check password.",
2020-06-09T16:08:37