Adding new users to Raspberry pi

In this post I am going to discuss how to add new users to Raspberry Pi and why you want to.

 

Users and usergroups are important even if you are a super user. Run the wrong application or script as an incorrect user and things can get bad really fast depending on the script (or you can think giving a young person root access). User groups are there to save us from our self. I have a few scripts I run that have to run that ask before you start if you sure you want to run as root user group. So in this short tutorial I am going to show you how to add a user and give the needed user group permissions.

Adding a user

Adding new users to raspberry pi is easy, just run

sudo adduser newuser

This command will add a /home/newuser folder and create a new group “newuser”

If you ever need to edit the password fo newuser just use the command:

sudo passwd newuser

If you want to really dig into the adduser run the following

 man adduser

Give user permissions

I am sure you would like the user to be able to have some permissions lets give them the basics

sudo adduser newuser dialout,audio,video,games,users

Also, you can run

usermod -G all,existing,groups,except,for,group newuser

need to remove the permissions just as easy as adding them

sudo deluser newuser root

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.