Hallooo peeps! Last time, I made a new user on Linux but in this one, instead of just making a new user, I’ll alo be adding a name for the user and add it into the ‘wheel’ group.

Here are the requirements:

  1. Username: cooldonkey
  2. Password: awesomedonkey24
  3. Name of account: “Donkey”
  4. Group: ‘cooldonkey’, ‘wheel’ (wheel group allows a user to run sudo command)

The first thing I’ll do is making the user so we’ll use the sudo useradd. But instead of just using useradd, I’ll also add in an option called –comment (-c). This will let me do number 3. Add a name for the user.

$ sudo useradd --comment "Donkey" cooldonkey

The first and third requirement has been accomplished. Now to do requirement 2. The same thing like the last post, I’ll use sudo passwd.

$ sudo passwd cooldonkey

The last requirement, assign cooldonkey to the ‘wheel’ group. i’ll be using two more options. –append and –groups. The ‘append’ will allow me to add cooldonkey to the group using –groups to ‘wheel’.

$ sudo usermod --append --groups wheel cooldonkey

Welp, I’ve done all the requirements so now cooldonkey is all done! Thanks for reading. Goodbye.

Reference: