shutdown ubuntu 16.04 from remote: "Interactive Authentication Required"

Asked by smurf

I have a pc with Ubuntu 16.04 working fine.
Now I have prepared the system with WOL to power on from remote (normally from my android phone) and it works fine from LAN and from WAN. I've a bunch of reasons to do this instead of keep it on 24/24.
The last step should be to shutdown the system from remote, I use an android ssh client that log easily into my ubuntu box, but if I give the command "shutdown -h 0" I receive the message:

Interactive authentication required

From local command line I can shutdown the system without sudo.

I understand that this is a security policy, but in my case I wish to override this policy, I'm the only user of the pc.

Is it possible?

Thanks a lot.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
smurf
Solved:
Last query:
Last reply:
Revision history for this message
smurf (luca-dgh) said :
#1

Nobody can answer my question?

Revision history for this message
smurf (luca-dgh) said :
#2

I found the trick.

I added this line to sudoers:

user_id ALL=(ALL:ALL) NOPASSWD: /sbin/shutdown

now I have to invoke sudo shutdown from remote, but no password is asked.

I think that the error message is not very clear, quite ambiguous.