Skip to content

Lab PC User Account Setup

Marco Tröster edited this page Nov 23, 2021 · 5 revisions

Create User Account

Log into the main account with sudo permissions. Then issue following command to create a new user account. It will prompt you several settings like display username, password, etc.

sudo adduser <username>

The interactive prompts will look something like this:

sudo adduser troestma
Adding user `troestma' ...
Adding new group `troestma' (1002) ...
Adding new user `troestma' (1002) with group `troestma' ...
Creating home directory `/home/troestma' ...
Copying files from `/etc/skel' ...
New password: 
Retype new password: 
passwd: password updated successfully
Changing the user information for troestma
Enter the new value, or press ENTER for the default
	Full Name []: Marco Tröster
	Room Number []: 
	Work Phone []: 
	Home Phone []: 
	Other []: 
chfn: name with non-ASCII characters: 'Marco Tröster'
Is the information correct? [Y/n] y

Assign User Account to Groups

Now you've got a blank user account. The problem with this is that you won't be able to install programs or access some hardware or launch Docker containers, etc. Therefore you'll need to assign you to following groups with the given command.

sudo usermod -aG <group> <username>

Groups to assign:

  • adm
  • cdrom
  • sudo
  • dip
  • plugdev
  • lpadmin
  • lxd
  • sambashare
  • docker

Note: You need a reboot to make the changes apply.

Validate User Group Assignment

After a reboot, you can log into the account you've just created. For a quick verification of settings, execute following command. It will list the groups your user account is assigned to.

id

An example output looks something like this:

uid=<userid>(<username>) gid=<userid>(<username>) groups=<userid>(<username>),4(adm),
24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),132(lxd),133(sambashare),136(docker)