0

Is there any possibility of creating a user, that can ONLY shutdown PC, but cannot write, read, use any other console, or command?

2 Answers 2

1

The last field in the /etc/passwd file for a user is the program run upon login, usually a shell like /bin/bash. Replace that /bin/bash with /sbin/poweroff, and you have a user that can only login, which runs the poweroff.

0

This is what you are looking for. Keep in mind, you need to create a shutdown rule in /etc/sudoers for that specific user with the following content:

user_name ALL=(ALL) NOPASSWD: /sbin/poweroff

or for passwordless:

user_name ALL=(ALL) NOPASSWD: /sbin/poweroff

Also you need the change the homefolder permissions to read-only.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .