The useradd command is used to create new users on a system.
Questions tagged [useradd]
236 questions
24
votes
3 answers
what does `adduser --disabled-login` do?
An install document I'm following instructs to add a user like so:
sudo adduser --disabled-login --gecos 'GitLab' git
The --disabled-login flag is absent from most man pages I have searched.
I've made two users, one with the --disabled-login…
spuder
- 18,053
10
votes
2 answers
is there any reason to avoid editing /etc/group directly
I find it much easier to edit files directly rather than remember commands like useradd -g, usermod, groupmod, etc. Is there anything wrong with just editing /etc/group directly?
Magnus
- 263
- 1
- 3
- 7
4
votes
1 answer
Using "useradd" command correctly
On Ubuntu 20.04, I am trying to add a user, however, it keeps failing. I don't see anything wrong and going crazy over a simple useradd command! What am I doing wrong?
root@myhost:~# uname -a
Linux dsdb 5.4.0-109-generic #123-Ubuntu SMP Fri Apr 8…
Ufder
- 149
3
votes
1 answer
Creating a system user in Debian without home directory still creates a non-existent home directory entry in /etc/passwd
I'm trying to create a system user in Debian, with no home directory, for use with getmail.
Even though I did:
adduser --system --group --no-create-home getmail
The entry in /etc/passwd is:
getmail:x:122:156::/home/getmail:/usr/sbin/nologin
even…
Faheem Mitha
- 35,108
3
votes
2 answers
Can't add users anymore by using useradd
Whenever I do
# useradd -N --gid 1003 -s /bin/ksh --uid --home /home/
useradd just refuses to add any user and prints instead:
useradd: Can't get unique secondary UID range
useradd: can't find…
tildearrow
- 559
- 5
- 12
3
votes
1 answer
added username, user unable to write to home directory
I added several users to my server using useradd -d /home/ . The users are able to log in and access their directories, but get Permission denied error messages when attempting to create files or directories.
I thought that…
mshpak
- 33
- 3
3
votes
1 answer
Accidentally included special characters in username when adding user
I was trying to add a user called joebloggs and accidentally hit other keys as I pressed enter:
useradd -u 12345 joebloggs$*
(on French keyboards the $ and * keys are next to Enter)
doing a cat of /etc/passwd doesn't show anything…
Rich
- 4,529
2
votes
1 answer
useradd --prefix option
If I'm not mistaken, the --prefix option of useradd should allow me to change the etc files from the directory I select, but it strangely adds an extra /.
I'm using Linux Mint 21.1 mate 64bit version if anybody asks.
The entire command I execute is…
mrdaemon
- 23
2
votes
1 answer
Can I write a template for creating a new user?
The command useradd new will create the /home/new directory.
Is there a way to create the /home/new and /home/new/check directories when useradd new is executed?
I don't want to write two commands for the job every time I create a new…
scrapy
- 333
1
vote
1 answer
Basic useradd question
I added one user with myname(prashant) but i had not set any password for same user account.
Still when i reboot(runlevel5), i os asked mi for password for same user account. I tried to login with without password as i not set, still authentication…
Prashant
- 11
1
vote
2 answers
Seeking a script that can loop ssh to a list of ips and perform useradd, home directory, creation and the user to the sudoers file
I have been looking all over for a simple way to combine various scripts to do this. I am not the strongest at scripting but I am working on improving so go easy on me. Any assistance here is appreciated.
I am not the author of this but I am using…
Glenn B.
- 11
1
vote
3 answers
Useradd w/o Home directory
I created a user without home directory using useradd -M Alice and set a password. Now when I login, I get this message
No directory /home/Alice! Logging in with home= "/"
-bash-4.1$
Can anyone explain the meaning of last line and solve this issue?
1
vote
1 answer
How to add 100 users from a file
I have 100 names no passwords and i have to create accounts for them under directory /home/top100
how do I do this? Because using useradd 100 times does not sound fun, and even if i did, I have no clue how o make the accounts appear under…
1
vote
1 answer
Why does the debian installer force me to use a username starting with a-z while adduser doesn't enfore this?
I have just installed Ubuntu Server, through the standard cli menu driven interface and it prompted me to create a new account.
Attempting to create my numerical user (e.g. 12345), I got an "Invalid Username" error, specifying that the username…
geedoubleya
- 4,327
0
votes
1 answer
How to create a new user and a txt file inside it?
I need to write a bash-script that will create a new user named user1 and an empty file
my_txt.txt in ~user1/tmp/ . The problem is terminal asks the password for new user and i don't know how to input it along su - user1
Axmed
- 1