This question arises on a Pi running RasPBX, which is Rasbian + Asterisk, but I think it will be the same under straight Raspbian. I run certain admin functions remotely against the PI from a Windows machine elsewhere on the network, by launching a putty window that executes a Linux command on connecting. I use putty's inbuilt feature for this, located in the connection settings at the root level of the SSH folder:
I didn't initially have a way to run these admin functions as a user with limited permissions, which it would make sense to do. After reading this useful info on *nx SE, it struck me the sudoers mechanism was the obvious way. But when I try to apply the linked guidance, starting with
edit the sudoers file with an existing sudo user, with the command
I am immediately advised, by a comment in the sudoers file being opened,
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
Fair enough, but when I go to directory
/etc/sudoers.d/, the one file there (README) passes the buck right back again:
# Finally, please note that using the visudo command is the recommended way
# to update sudoers content, since it protects against many failure modes.
I want to do it right, but doing it right would appear not to be an option. I guess I'll have to toss a coin. Unless the community has any more wisdom on this?