1

After adding myself as a user in User Accounts on a persistent USB install, I find it is impossible to shut down using the Shut Down command on the top panel.

Is there a way to fix this?

"sudo shutdown -h now" works, but requires opening terminal and typing a password. I am hoping for something simpler, maybe adding a desktop icon.

C.S.Cameron
  • 19,519

1 Answers1

1

If you have sudo set to NOPASSWD for your user, then you can create a desktop icon containing this text:

#!/bin/bash sudo shutdown -r now

chmod +x ~/desktop/yourfile and it will do this task for you.

  • A few more questions please. Is there a simple way to create a desktop icon? Right clicking the desktop used to work, but no more. Googling, I could not find a method for my simple brain to follow. Also, is there anything like an exception list for sudo? I don't think I need a password to shut down, but would like one for things like installing software and viruses. – C.S.Cameron Feb 08 '15 at 03:59
  • Right-click ought to work. Sudo works better as an inclusion list - where you edit the sudoers file, you can explicitly permit a program (or list) to be NOPASSWD. Take a look at man sudoers - there are examples. – Mark Williams Feb 08 '15 at 08:17
  • Right clicking is still not working for me, but I have to give you credit for getting me on the right track. – C.S.Cameron Feb 08 '15 at 11:06
  • Right-click menu in an unspecified desktop manager is a whole other question! Is it Unity, Gnome, xfce, ..? – Mark Williams Feb 08 '15 at 15:28
  • ubuntu-14.04.1-desktop-i386 , Is there something I got to click to give you points? – C.S.Cameron Feb 11 '15 at 04:25
  • Plain ubuntu - probably Unity desktop then - I don't use/like it, which is why I left it as 'a different question' - seriously, pose it as a separate question! Does this look like the same thing? You did the 'points' thing already, thank you. – Mark Williams Feb 11 '15 at 14:35
  • But you can also upvote the answer in addtion to accepting it. The upvote is done by clicking the light grey arrow pointing up above "0" at the top left of the answer. – DK Bose Mar 25 '16 at 15:53