Questions tagged [useradd]

The `useradd` command is used to create new users on a system.

Filter by
Sorted by
Tagged with
2
votes
1answer
45 views

What are reasons for organising /home with initial-letter subdirs (ie LETTERHOMES)?

On my home Linux, a user named toto will have its home in /home/toto. On the system at my high school, such an user would be in /home/t/toto. I understand this is due to the configuration of ...
1
vote
1answer
24 views

Primary and secondary group of a user

Why is it that group1 which should be user's primary group, is in the subgroups? The user is not even part of group1 in /etc/group file. # id user uid=1000(user) gid=1111(group1) groups=1111(group1),...
26
votes
3answers
48k views

Add a user without password but with SSH and public key

I want to add a user to Red Hat Linux that will not use a password for logging in, but instead use a public key for ssh. This would be on the command line.
4
votes
4answers
9k views

Why is the default umask value for useradd in openSUSE set to 022?

I recently built a very simple test environment with openSUSE. As I tried to configure a shared directory, without using ACLs, but with SetGID on that directory instead for some reason, I noticed ...
3
votes
2answers
2k views

Why useradd -m doesn't fill created home dir with some defaults?

My motives: I want to create deployment script which prepare all system with just 1 click, and although learn Linux this way. So I don't want to use interactive utils like adduser (all interaction ...
0
votes
3answers
17k views

How to create user and password in one script for 100+ users

I have written a script for adding and setting password for 100+ users. Eg: for setting password of the user I want to set in "user+123" format for all the users I.e user will change according to the ...
7
votes
2answers
580 views

What is the use of option -o in the useradd command?

What is the use of option -o for command useradd? What is a good use case of this option?
-1
votes
1answer
174 views

User is not successfully created in RedHat

I'm trying to create a user in RedHat 6.7 but it's not working useradd testDoesn't give any errors, but /etc/passwd doesn't have the username Thus passwd testis failing
2
votes
1answer
16k views

useradd on CentOS with home directory and sudo privileges

There are so many variants to adduser or useradd -- which is correct? On CentOS release 5.11 (Final) I'm using adduser --create-home baz but somewhat prefer the way Ubuntu asks extraneous questions ...
-1
votes
3answers
4k views

how to create user that have same permission as root in CentOS 7?

how to create user that have same permission as root in CentOS 7?
3
votes
1answer
250 views

empty /etc/skel still adds default directories

I am using elementary freya and creating a new user with root# useradd -s /bin/bash -mk /etc/skel -d /home/secret -c otherme agentb24 and my /etc/skel is empty and I also want my new user home to be ...
0
votes
2answers
26 views

Trying to script with 'useradd', can't understand examples

I am trying to use useradd. I found an example of something I'd like to try and incorporate, though I can't understand specific parts. Here is the example in entirety: if [ $(id -u) -eq 0 ]; then ...
6
votes
1answer
8k views

How to Create local user in LDAP enabled linux systems

During my application install, I used to create a new group and a new user using the 'groupadd' and 'useradd' commands groupadd my_group useradd -r -s /sbin/nologin -g my_group my_user But in one of ...
4
votes
1answer
8k views

Using hashed password for adduser function in Linux

Sorry, I´m novice in Linux and I am looking for information, how to create new user account in Debian with pre-defined encrypted password. I have a function in bash, that if new user´s id´s are not ...
5
votes
3answers
43k views

How to create a user with given password on SuSE from command line?

I need to create bunch of new users with given password. What I want is a script that I would pass the user name of new user and it will create/add the user and set its password. (the password is the ...
2
votes
4answers
8k views

Add new user in solaris

I tried to add a new user in solaris 10, but got an error: $ useradd -g oinstall -G dba -d /export/home/oracle oracle UX: useradd: ERROR: Inconsistent password files. See pwconv(1M). I ran pwconv, ...
2
votes
1answer
35 views

Solaris 5.10 shell replacement for Centos 7 migration

I have an old Solaris 5.10 server. I'm migrating the tomcat products to Centos 7. There are two accounts on the Solaris server that I need to migrate. The shells for both of those accounts are ...
0
votes
0answers
54 views

User entries not deleting in lastlog file in Solaris

I am deleting a user in Solaris 10 and 11.  If I delete a user using the command userdel -r test1 and then check my lastlog file /export/home/ch185140/lastlog, I get output like this: 1 tj100201 ...
7
votes
3answers
5k views

What is the difference between -g and -G options in useradd

After I look through the help. I didn't found much difference between them. -g, --gid GROUP The group name or number of the user's initial login group. The group name must exist. A group ...
2
votes
1answer
715 views

Create multiple username and UID in Linux using shell script

In my environment I constantly have to attach an NFS server running on Linux. The Linux client system has user names created in it and they are in a sequential order. But in order to set the sharing ...
3
votes
1answer
2k views

difference between useradd -b and useradd -d

Can somebody please explain to me the exact differences between useradd -b and useradd -d in [Debian] Linux? Both seem to work quite similar to me, but then I spot differences that confuse me.
2
votes
1answer
3k views

How to add folder to existing user [proftpd]

As we know we can add folder to user using useradd user -p user_passwd -d /home/ftp/user_dir/ -s /bin/false but how to add folder to existing user, for example /home/ftp/root for root ?
4
votes
2answers
23k views

Add user and set password using Ansible

I have created an Ansible playbook to create user and set password. But it is giving me an error ERROR: password is not a legal parameter of an Ansible Play --- - hosts: all user: root vars: ...
0
votes
2answers
615 views

Creating a working bash script that auto creates admin users in linux

The script below is what I have tried already but it still asked me for the user's password and other information when it ran. #!/bin/bash PASSWORD="somepassword" USERNAME="default" if id -u "$...
7
votes
2answers
2k views

Should I use useradd or adduser?

I am trying to add a new user to the system. I am confused though which command to run: useradd or adduser?
1
vote
0answers
64 views

Why my newly created user is not inheriting $PATH variable

I added a new user dev on my Alpine based image. After switching to the new user I see env variables are different in case of both root and dev user. Specially $PATH variable is different. But I think ...
5
votes
3answers
986 views

Newly created user on Ubuntu Server has the wrong shell prompt

I've created a new user in the Ubuntu 18.04.01 like this: sudo useradd svn sudo passwd svn sudo mkhomedir_helper svn sudo usermod -d /home/svn -m svn Problem is, that if I switch to the user by su ...
24
votes
3answers
117k views

User without a password - how can one login into that account from a non-root account

I have just started to use Scientific Linux (7.0) (although I assume this question might be distribution neutral..). The kernel version is 3.10.0-123.20.1.el7.x86_64. Coming back to my question. I ...
-1
votes
1answer
438 views

SVN Installation and adding user

I installed SVN in my linux server a year back by following some documentation online and I created two users to my svn repository. I need to add few more users to my repository and I completely ...
2
votes
1answer
402 views

adduser Firstname.Lastname

I tried to use both useradd and adduser to get a username typed as Firstname.Lastname. I tried also installing libuser and using luseradd, but also I got error. Is there a way to do that (of course it ...
-4
votes
1answer
95 views

What files are created when using useradd [closed]

Which files will be created when using the command useradd ? I know that it will modify /etc/passwd, /etc/group, and /etc/shadow and that it copies home/skel to the user's home directory. I want to ...
0
votes
1answer
191 views

useradd with no options

When I create a user with useradd (no option) I can later add his passwd by using passwd new_user. How can I create his correct home directory (with Desktop and Templates inside) and all other ...
0
votes
1answer
134 views

Why passwd prohibits me from setting “simple” password?

I used console command passwd to change my own password that I set straight after the OS installation with useradd command. My original password contained only line characters, without capitalization, ...
1
vote
1answer
35 views

Setting up VM login instead of Local login [closed]

I had a question earlier, it is tied into this, that one was looking for the proper procedure, this one is looking how to implement. If you need a backstory refer to My first question I have a local ...
0
votes
2answers
3k views

Restrict user to do SFTP on the www folder owned by www-data group

I would like to create a new user with read/write privileges ONLY in the /var/www/ directory including all sub-directories. The /var/www/ is owned by a group called www-data. Best way to do it I ...
3
votes
2answers
10k views

Creating Group and User for Tomcat RHEL/CentOS

I want to create an user for my Tomcat installation, but I was viewing multiple options: # groupadd tomcat # # useradd -g tomcat -d /usr/local/tomcat tomcat # useradd -g tomcat -c "Tomcat User" -d /...
0
votes
2answers
3k views

Create user from bash script

I'm in the process of making a bash script to automate adding a user. My password always have pattern, so I am setting that to a variable then... (this is where I am stuck -encrypting-). I found this ...
0
votes
1answer
348 views

ssh with new user failing with Permission denied (publickey)

I am trying to create user on EC2, following are the steps I performed. root$ adduser abc --disabled-password root$ sudo su abc abc$ mkdir /home/abc/.ssh abc$ chmod 700 /home/abc/.ssh abc$ touch /...
0
votes
1answer
216 views

Give default path for id_rsa in a shell script

I want to automate user creation along with the rsa key generation in a shell script. But while generating the rsa key we need to give inputs for these three things. Enter file in which to save the ...
0
votes
3answers
31k views

No home directory, logging in with HOME=/ [closed]

Created a new user in Ubuntu 11.04 using: $ useradd -d /home/dummy -m dummy Now, after this I set its password using passwd dummy, but when I login to that user using su - dummy. I get the message: ...
0
votes
0answers
106 views

How to configure which characters are allowed in CentOS usernames

In systems such as Debian, there is a file /etc/adduser.conf which includes directive NAME_REGEX that can be used to define which characters are allowed in a username. Is there a way to do this in ...
-4
votes
1answer
416 views

unix, adding users to existing directory in centos

I'm trying to add users to an existing directory but I keep getting: useradd: warning: the home directory already exists. Not copying any file from skel directory into it. I want to add users to ...
6
votes
2answers
665 views

adduser has no difference from useradd

When I use the adduser command on fedora, it's not aksing for password or fullname. It's working exactly like useradd. I don't understand why. [hugues@localhost ~]$ sudo adduser user1 [hugues@...
2
votes
1answer
688 views

Parsing through a CSV file to add users

I'm having trouble parsing through a CSV file to add users. I wrote a small script to add a list of 1000 users: export IFS="," cat users.csv | while read a b c d e f g; do useradd -d -u $a -U $d ; ...
1
vote
0answers
217 views

Debian 9 - useradd

Here is an extract of /etc/default/useradd: GROUP=1005 Here is an extract of /etc/login.defs: USERGROUPS_ENAB no Here is the useradd command I run to create a user: $ sudo useradd test22 $ id -a ...
6
votes
4answers
7k views

How should I add users non-interactively?

I have a set of users I need to add to a new system as part of a BASH script that preps my server. How can I non-interactively add the user, create their home directory, set the group, and enter a ...
0
votes
1answer
74 views

How can I automate adding a new user, using an existing user's groups?

Raspberry pi comes with a default user account that is added to multiple groups: username@hostname:~ $ groups pi pi : pi adm dialout cdrom sudo audio video plugdev games users input netdev spi i2c ...
0
votes
2answers
627 views

Can I userdel a user without removing their home directory?

I did the following: useradd -d /home/iauser -m -s /bin/bash -c "IA User" iauser got this error: UX: useradd: ERROR: Create home directory failed. Operation not applicable It created an entry in ...
1
vote
1answer
118 views

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 ...
0
votes
1answer
394 views

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 ...