We were instructed to add a user to the system in three different ways, so we could compare the methods to each other. Here is a summary of what each method entailed in my experience:
Assignment 2: Adding a user at the command line with adduser
This went as described. The plethora of different switches available for the commands was a little intimidating; I needed to go back and review them and to have the .pdf files open in front of me to make sure I understood what I was doing. And of course I had to use sudo in order to make these changes because I needed superuser powers!
- The order of commands made sense: I had to use groupadd to create a new group before I could add a user, since each user needs to be assigned to a group when created, and the group needs to exist first. I named the group the same as the new user, which I named userme.
- Then I used useraddto add the new user. The switch –g defines the user’s initial login group; this was the group I created previously with groupadd. The switch –G defines additional groups that the user belongs to; the command line we were instructed to use indicated that my new user also belonged to a group named users. The switch –m makes the user’s home directory if it doesn’t already exist.
- Then I used the passwd command to give the new user a password.
- As the assignment suggested, after I logged out and then logged in again as the new user (userme) , I found I could not use the sudo command because my new user was not listed in the group sudoers, which meant I did not have administrator privileges.
- So I logged out and back in as mebell. I used the grep command to do a string search of the /var/log/auth.log file for the string “userme” and I found an entry in the auth.log file that showed I tried to execute a command using sudo privileges from an unauthorized account.
I found using the command line easy and powerful, since I could tell it exactly what I wanted. But I had to know what I wanted, and I had to understand all the switches in order to use it properly, and had to understand the order of commands (for example, that I had to create the group first before I created the user. Also, when there is an error message, I have to know where to look to fix the problem (like the auth.log file). Fortunately one can use the usermod command to change settings later for a user.
Adding a user with Webmin
I had no trouble logging into Webmin. Finding the correct menu items was also easy and fairly intuitive. I found it easy to create a group and a user (which I named useryou), and the default settings made it fast, but powerful. I like that the settings on the groups and users tabs had default values but also gave me drop-down menus so I could see the available choices. This would be handy if I had to configure several users and groups; I especially liked that you could create a user and have webmin create a group for you, so that you didn’t have to know the order of the commands like you do with the command line. It seems that it would be easier to do the tasks without making a mistake, especially if you had several tasks to do, or if you had many users and groups; it would help avoid making typos as one could at the command line. Also, although we didn’t do this in the assignment, from the reading it seems that the webmin batch commands could also be very powerful, if I wanted to create multiple users and groups and execute commands before/after creating new users.