adduser and addgroup are friendlier front ends to useradd, groupadd and usermod.
Questions tagged [adduser]
152 questions
610
votes
10 answers
What is the difference between adduser and useradd?
What is the difference between the commands adduser and useradd on Ubuntu?
Joe Cabezas
- 6,253
- 3
- 15
- 7
328
votes
3 answers
Run adduser non-interactively
I'd like to use the adduser command to add a user (with disabled password) via a shell script.
By default, adduser prompts you for various values (e.g., Full Name). Is there any way to submit these values via command line? Or will I need to useradd…
Lorin Hochstein
- 5,265
- 7
- 25
- 31
97
votes
4 answers
How can I create an administrator user from the command line?
I want to create a user with administrative privileges and all the regular setups like home directory.
Is there a adduser parameter to give the user sudo powers automatically?
What are the default settings for adduser? Will it automatically create…
Oxwivi
- 17,589
- 53
- 136
- 197
87
votes
6 answers
How to make user home folder after account creation?
I created a new user with useradd name and forgot to use -d -m to create their home directory. I tried making one, copying the contents of /etc/skel, and chowning everything to the new user.
Aliases don't work, such as ll, and I just have a $ at…
mortona42
- 971
- 1
- 6
- 4
78
votes
1 answer
Create the home directory while creating a user
I have added user using the adduser command, but a directory with is new user name is not created in /home, and I'm also not able to run any command with this user. After logging from this user it's only showing($) on the screen using a cli
Simmerjeet
- 895
- 1
- 6
- 7
52
votes
3 answers
How do you change the default shell for ALL USERS to bash?
I want every new user from now on to have bash as their shell by default.
I know that to change your own shell to bash, you would use the command "chsh -s /bin/bash", but how do I automatically set all future users' shell to bash by default?
coffee-grinder
- 3,875
- 8
- 25
- 22
46
votes
2 answers
What do the `--disabled-login` and `--gecos` options of `adduser` command stand for?
Running Ubuntu 12.04, I setup a private git server and created a group called git some time ago. Now I am following a guide to install gitlab and when it came to adding a user to the git group and create it, I saw that I already had it.
The command…
Private
- 3,884
- 9
- 34
- 48
28
votes
5 answers
"Failed to create user" due to regular expression error
I'm running Ubuntu 12.10 desktop 32 bit. Currently I have only a user, type administrator. I'd like to create another administrator user but I keep getting the following error:
Failed to create…
Daniel
- 281
- 1
- 3
- 3
25
votes
5 answers
password does not work with useradd -p
I am running ubuntu 14.04 LTS. I ran the following command to create a user
$sudo useradd -m -p password1 guest_user
and then tried to switch to the user with
$su guest_user
But i could not login with password1
Am i missing something? Am i…
user2065276
- 371
- 1
- 3
- 6
23
votes
2 answers
"Could not chdir to home directory /home/me: No such file or directory"
I am using 12.04 on my server.
I created a new user using adduser me and passwd me and added it to sudo.
When I log in this is what I see.
Could not chdir to home directory /home/me: No such file or directory
$
I type bash and it begins to look…
ddd
- 231
- 1
- 2
- 5
20
votes
4 answers
Proper way to add a user account via bash script
Here's the script code I'm using now:
getent group $MYGROUP
if [ $? -ne 0 ] ; then
sudo su -c "groupadd $MYGROUP"
fi
sudo su -c "useradd mynewuser -p mypassword -m -g $PRIMARYGRP -G $MYGROUP"
This approach works well on openSuse. But there are…
MountainX
- 5,729
- 19
- 65
- 90
18
votes
4 answers
adduser says user exists when the user does not exist
As the subject says, I'm trying to add a new user. When I run the command, it says the user already exists. But looking in /etc/passwd, /etc/group, and /etc/shadow shows that the user does not exist.
Running the command on my local machine works…
David R.
- 537
- 1
- 5
- 12
17
votes
1 answer
"Admin" user automatically has sudo privileges
I added a user named "admin" to my Ubuntu 14.04LTS server, using adduser.
I'm used to having to add a user to the /etc/sudoers file when adding a new user that needs sudo privileges, but this time I didn't. It doesn't appear the 'admin' user…
trpt4him
- 273
- 1
- 5
14
votes
2 answers
Difference between adduser and usermod -G -a
What is the difference between
adduser user_name group_name
and
usermod -G -a user_name group_name
At first glance they seems to do the same thing : add a user to a group.
snoob dogg
- 240
- 1
- 2
- 10
13
votes
1 answer
How to create new user with Public key authentication?
I have Ubuntu Server 14.04 LTS. I have Public key authentication enabled by default.
I used the following command to create new user:
sudo useradd -m -c "John T." john -s /bin/bash
The command apparently created user, user's home folder... but…
Maris B.
- 433
- 2
- 6
- 17