useradd: user already exists
Filed Under
Linux at 18th November 2013 0:01 by
Danny
Adding a user to an existing group may give an error:
useradd: user 'name' already exists
where name is the username. An example of this command should look similar to sudo useradd -G sambashare danny
where sambashare is the group and danny is the username.
In the above case usermod should be used instead of useradd. This is because useradd creates and adds the user but if the user already exists then it needs to be modified. A modified example of above should look like this:
sudo usermod -a -G sambashare danny
About Danny
I.T software professional always studying and applying the knowledge gained and one way of doing this is to blog.
Danny also has participates in a part time project called Energy@Home [http://code.google.com/p/energyathome/] for monitoring energy usage on a premise.
Dedicated to I.T since studying pure Information Technology since the age of 16, Danny Tsang working in the field that he has aimed for since leaving school.
View all posts by Danny →
This entry was posted in
Linux and tagged
bash,
Linux. Bookmark the
permalink.