Tuesday, 31 May 2011

Adding a new user and default user groups in Crunchbang

Recently I had a bit of an accident when I stupidly entered the wrong letter letter into a command and ended up removing myself from all the default groups on my profile in Crunchbang Linux. No problem, I thought, I'll just use the same groups that I added my username to when I created my Gentoo system. Problem: Gentoo and Crunchbang (Debian based) use different groups. This was a more annoying problem than I expected.

This resulted in a lot of wasted time so I thought I would share the experience so that it could be easily fixed without wasting the amount of time I did in looking for a solution.

To add a user we simply open up a terminal and type (as root) the command adduser

This will ask for some details of the new user including name, username and password. This will give a new user a working login and a home folder, however it will not give the new user any group privileges. The default groups that Crunchbang assigns to a user upon installation are:
  • cdrom floppy sudo audio dip video plugdev netdev bluetooth powerdev
To add the user to these groups we enter the command (as root):
usermod -a -G cdrom,floppy,sudo,audio,dip,video,plugdev,netdev,bluetooth,powerdev {the new username}
Please note that the above command may appear to be on different lines, but it should be written all on one line with a space after "-G" and after "powerdev", all the groups are separated with commas. Once you have done this then your new user is ready. Don't forget to add the new user to the sudoers file, if your not sure about this then take a look at this post for some extra help. If your like me and you end up removing the user from the groups then simply add your current username to the above command.

1 comment:

  1. Great post. One thing that I realized was that the adduser command needs the users name.

    sudo adduser newusername

    The groups listed out were great. Thanks!

    I will have a new post coming up soon on my blog, http://www.tuxmatters.com about setting up #!/crunchbang for my grandmother.

    ReplyDelete