Add user to a group
I'm using the McGraw Hill Osborne Linux+ Study Guide by Robb Tracy. Chapter 7 - Working with Users and Groups has the following: page 374
"Add you user account and the dtracy user account to the research group by entering groupmod -A "dtracy,your_username" research"
This is supposed to add the 2 users to the research group but it does not I had to enter the following command to add these users to the research group:
adduser dtracy research
adduser jim research
this worked (thank Ubuntu documentation) but the command from the Linux+ book did not. am I missing something here. And yes, I am very new to Linux
thanks
"Add you user account and the dtracy user account to the research group by entering groupmod -A "dtracy,your_username" research"
This is supposed to add the 2 users to the research group but it does not I had to enter the following command to add these users to the research group:
adduser dtracy research
adduser jim research
this worked (thank Ubuntu documentation) but the command from the Linux+ book did not. am I missing something here. And yes, I am very new to Linux
thanks
Comments
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do.
I'm using Ununtu 7 and I'm also using the latest distro of Damn Small Linux.
The adduser <USERNAME> <GROUPNAME> command worked for both of these distros. I am planing on installing Fedora onto a machine this weekend to start playing around with that as well. My concern is that the info in this little lab exercise in the McGraw Hill book in incorrect.
I'd recommend first doing a man search on the command the book talks about, see if it's even mentioned by your distro, and then checking the official documentation to see if it's supported. In this case, if they're using a Red Hat based version of Linux, and you're using a Debian-based distro, the commands may not carry over. A good approach is to get yourself VMware or Virtual PC and install a couple of different variations of Linux to test out commands on and work with. You'll find a lot of similarities between distros, but there are differences as well. BSD-based vs. Sys V, RPMs vs. Debian-installer packages vs. tarballs, the various desktop managers, startup processes, etc.
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do.
To add a user to a group (while the user already exists) use the command:
usermod -G [group] [userName]
As far as I know, the only thing groupmod is capable of is changing the GID or the group name (with root level access).
I believe BeaverC32's right on the money. When doing the TestOut for Linux+, I remember the trainer talking about groupmod being used to modify groups, and usermod being used to modify users. And, since adding a user to a group doesn't actually change the properties of the group, it's considered a usermod function.
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do.
I have gone through the man pages, the McGraw Hill books uses Fedora and SuSE. I just don't want anyother nubies like myself to read this and come away with false info. This just goes to show you that the best way to learn this it to actually run through all the commands over and over again so you know what does and what does not work.
thanks
Truer words have never been spoken, hands-on experience is important for every cert. With Linux+, using and knowing the command-line tools is especially important, because a lot of questions will ask you what a command does, which command to use for a particular task, or which flag to use when doing a particular task. (Knowing the difference between usermod -g and usermod -G would be useful to know for the test.)
Free Microsoft Training: Microsoft Learn
Free PowerShell Resources: Top PowerShell Blogs
Free DevOps/Azure Resources: Visual Studio Dev Essentials
Let it never be said that I didn't do the very least I could do.
www.blacksintechnology.net
This is the command I would get used to. It flows across to many other platforms besides linux (i.e. freebsd, solaris, etc...).
Plus the usermod command has other options that are good for adjusting user accounts. Some folks will actually vi the /etc/group files, but I do not recommend this.