Some doubts about the use of usermod and groupmod command
- by AndreaNobili
I am not yet a true "Linux guy" and I have the following doubts about how exactly do the following shell procedure (a list of commands steps) founded in a tutorial that I am following (I want deeply understand what I am doing before do it):
sudo passwd root
then login again as root
usermod -l miner pi
usermod -m -d /home/miner miner
groupmod -n miner pi
exit
So at the beginning it enable the root account and I have to login again in the system as root...this is perfectly clear for me.
And now I have the followings doubts:
1) The usermod command:
usermod -l miner pi
usermod -m -d /home/miner miner
Reading the official documentation of the usermod command I understand that this command modify the informations related to an existing account
Reading the documentation it seems to me that the -l parmether modify the name of the user pi in miner and then the -m -d paramether move the contents of the old home directory to the new one (named miner) and use this new directory as home directory
My doubt is: what exactly do the executions of these operation? I think that:
Rename the existing pi user in miner
Then move the content of the old home directory (the pi home directory? or what?) into a new directory (/home/miner) that now is the home directory for the miner user.
Is it right?
The the second doubt is related to this command
groupmod -n miner pi
It seems to me that change the group name from pi in miner
But what exactly is a group in Linux and why is it used?
Tnx