I want to let one of my friends use my Raspberry Pi remotely, but I don't want him to have access to raspi-config to change settings. Is there any way to block access to raspi-config or set a separate password??
1 Answer
You may want to add a new user like Steve said, and revoke sudo
privileges from that user. Here is a quick tutorial on this:
sudo useradd USERNAME
Obviously you need to replace USERNAME
with the name of the user you want. Then, you will need to set a password for that user with:
sudo passwd USERNAME
If you do not set a password the user will be locked until you do. Then, to revoke privileges:
sudo deluser USERNAME sudo
This will remove the user USERNAME
from the group sudo
.
Here are some complete tutorials, just in case:
-
Have you actually tried this. Last time I did (a long time ago) you had to specifically add groups to the new user. Jan 20, 2016 at 3:33
-
Only if you want that user to be a member of those groups. There will be a new group added for it automatically (see
man useradd
).– goldilocks ♦Jan 20, 2016 at 8:24
sudo
does need to be done carefully, the recommendation is to usesudo -e /etc/sudoers
which invokes a consistency check on a temporary edit version, only replacing the real file if it makes sense. This can help you to avoid locked yourself out of the system. As @SteveRobillard suggests a separate account is really sensible - check out theadduser
command (needs root privileges) - Unix always was multi-user system from the ground up (unlike certain products from Redmond in the US of A) and remote access by others is well within capabilities of a RPi *nix distribution.