What is the proper command to shutdown or reboot the system safely? Is there a way to achieve this without invoking sudo
?
-
What version of Ubuntu are you using? – George Udosen Apr 10 '17 at 15:33
-
I am using KDE 16.10 – mat Apr 10 '17 at 15:35
There are a number of options availabe, the easiest I have found for shutdown is sudo poweroff
and for restart is sudo reboot
. In general you will need to root privileges to perform these commands (security control - prevents users from bringing a system down without privilege escalation) although if you really tire of typing sudo every time, you can create aliases vim ~/.bashrc_aliases
and add alias poweroff="sudo poweroff"
and alias reboot="sudo reboot"
. You can substitute vim
with your favorite editor.
Edit: It was pointed out to me that the Desktop versions of Ubuntu 16.04 or greater no longer require sudo
to perform these commands, however the Server versions do. Thank you Zanna for pointing that out to me.
-
@Zanna I think that's only for the desktop version. For the server version I've always needed
sudo
. I should have specified. – Gansheim Apr 11 '17 at 13:18 -
1Is it less safe or less good to use
sudo shutdown
for shutdown? Do these use TERM signal to terminate processes before shutting down? – jarno Jan 20 '20 at 19:27