O'Reilly logo

Raspberry Pi For Dummies by Mike Cook, Sean McManus

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managing User Accounts on Your Raspberry Pi

If you want to share the Raspberry Pi with different family members, you could create a user account for each one, so they all have their own home directory. The robust permissions in Linux help to ensure that people can’t accidentally delete each other’s files too.

When we looked at the long listing format, we discussed permissions. You might remember that users can be members of groups. On the Raspberry Pi, groups control access to resources like the audio and video hardware, so before you can create a new user account, you need to understand which groups that user should belong to. To find out, use the groups command to see which groups the default pi user is a member of:

pi@raspberrypi ~ $ groups pi

pi : pi adm dialout cdrom sudo audio video plugdev games users netdev input

warning_bomb.eps When you create a new user, you want to make them a member of most of these groups, except for the group pi (which is the group for the user pi). Be warned that if you give a user membership of the sudo group, they will be able to install software, change passwords, and do pretty much anything on the machine (if they know how). In a home or family setting, that should be fine, however. The permissions system still protects users from accidentally deleting data they shouldn’t, as long as they steer clear of the sudo command.

To add a user, you use the useradd command ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required