I acquired a new desktop a couple of months ago, and, feeling adventurous, I thought I would take a chance on a different Linux distribution from Ubuntu, which I'd used exclusively up to that point, and installed MX Linux. On the whole, I quite like MX Linux; I don't regret installing it. However, one oddity of the distribution has recently been causing me grief.

I realised shortly after installing MX Linux that calling reboot on its own will not do anything. You have to call sudo reboot. Initially, this was just a minor irritation. However, I'm now trying to do some more exciting stuff with scripting: a context in which having to get superuser privileges every five minutes would be a serious pain in the neck. Is there any easy way of changing things so that one could call reboot on its own? Is there some other command, which doesn't require superuser privileges, and which would also restart the system?


If you don't mind typing in a password (a good practice) you create $HOME/bin/reboot that contains the line:

sudo /sbin/reboot

Make sure your PATH has $HOME/bin at its beginning.

If you want to call reboot without typing a password, add this line to the end of /etc/sudoers

YourUserID ALL = NOPASSWD: /sbin/reboot # Replace YourUserID with your user id.

This gives your user the right to call /sbin/reboot without typing a password. You'll need to logout and log back in for this to take effect.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.