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.
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.
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
What is the difference between the commands adduser
and useradd
on Ubuntu?
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 just fine. I'm running Ubuntu 11.10 on both.
Here's my terminal commands and output:
root@ws-prod-www-01:~# useradd -s /sbin/nologin -m -d /var/www/html/atc -g 33 -u 10141 atc
useradd: user 'atc' already exists
root@ws-prod-www-01:~# grep atc /etc/passwd
speech-dispatcher:x:111:29:Speech Dispatcher,,,:/var/run/speech-dispatcher:/bin/sh
root@ws-prod-www-01:~# grep atc /etc/shadow
speech-dispatcher:!:15259:0:99999:7:::
root@ws-prod-www-01:~# grep atc /etc/group
root@ws-prod-www-01:~#
I also tried:
root@ws-prod-www-01:~# adduser --shell /sbin/nologin --home /var/www/html/atc --gid 33 --uid 10141 atc
Warning: The home dir /var/www/html/atc you specified already exists.
adduser: The user `atc' already exists.
root@ws-prod-www-01:~#
Any thoughts?
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
instead?