Home > Articles > Operating Systems, Server > Linux/UNIX/Open Source

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Dealing with Users and Groups

You can use the following commands to administer users and groups:

  • adduser: The adduser command will create a new user. To simply create a new user, type sudo adduser $loginname. This will create the user's home directory and default group. It will prompt for a user password and then further details about the user.
  • passwd: The passwd command will change the user's password. If simply run by a regular user, it will change his password. If run using sudo, it can change any user's password. For example, sudo passwd joe will change Joe's password.
  • who: The who command will tell you who is currently logged into the machine.
  • addgroup: The addgroup command will add a new group. To create a new group, type sudo addgroup $groupname.
  • deluser: The deluser command will remove a user from the system. To remove their files and home directory, you need to add the -remove-home option
  • delgroup: The delgroup command will remove a group from the system. You cannot remove a group that is the primary group of any users.
  • + Share This
  • 🔖 Save To Your Account