useradd / usermod

Most full-featured modern Linux distributions have graphical ways of managing users. And you certainly won't need to manage any users on the McKelvey Cluster. But it's worth having here as a reference.

useraddĀ 

useradd creates a user. You can customize certain things. The -m flag creates a home directory. You can update what a default home directory looks like in the folder /etc/skel . For instance if you want all new users to have a Downloads folder, a Documents folder, and a Coding folder. You can use mkdir /etc/skel/{Downloads,Documents,Coding } to create the directories, then useradd -m newuser .

You can use man useradd to see all of the options.

FlagEffectExample
-pSet a passworduseradd -p $TR0ngP@$$w0r6 newuser
-GSet additional groups (especially useful for giving sudo privileges). Multiple groups can be separated by commauseradd -G wheel,docker -p password newuser
-sSet a default shell besides Bash. For instance, some like zshuseradd -s /bin/zsh -G wheel -p pass newuser
-mCreates a home directoryuseradd -m -s /bin/zsh -G wheel -p pass newuser

usermodĀ 

usermodĀ  functions almost identically to useraddĀ  but it changes settings on already existing users. So if you want to change your shell from bash to zsh, you can use usermod -s /bin/zsh myuser .

One thing that is important to keep in mind is that any attribute you set will completely overwrite the previously existing attribute. For instance, if myuserĀ  is in the wheel group giving them sudoĀ  privileges, and you want to add them to the dockerĀ  group because you are starting to use docker , you might run usermod -G docker myuser . The problem with this is that myuser will be removed from the wheelĀ  group and added to the dockerĀ  group removing their sudoĀ  privileges. The way to avoid this is to use the -aĀ  flag to "append" the new attribute to the old one. For example usermod -a -G docker myuserĀ  will just add myuser to the docker group and not remove them from anything.