Questions tagged [useradd]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
280 views

I created a new group & new user. I then added the user to the group. How can I change to that user?

I created a new group called tomcat and then created a new user called tomcat that I added to group tomcat: sudo groupadd tomcat sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat whoami ...
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 ...
1
vote
2answers
125 views

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 ...
4
votes
2answers
3k views

Default shell not being selected with useradd

I have a fresh version of Ubuntu 16.04.1 installed and have tried to create a new user account through root. I have changed the SHELL line in /etc/default/useradd to read as follows: SHELL=/bin/bash ...
1
vote
0answers
28 views

Unable to add users [duplicate]

When I try to adduser or useradd it says command is "not found". Some sources suggest adding /usr/sbin to PATH, but it's already there. Some sources suggest first logging on as root, but su returns "...
-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?
-1
votes
1answer
175 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
0
votes
1answer
1k views

Creating user with bash script with arguments

I am trying to make a script that will make a (s)ftp user, but it keeps failing and i don' t know why. If i echo the command its fine, and i can copy and paste it to create the user, but if i execute ...
0
votes
2answers
1k views

Bash - How to shorten username in PS1

Currently my prompt is: xiaobai@dnxb:/tmp$ root@dnxb:/tmp# My desired prompt: xb@dnxb:/tmp$ rt@dnxb:/tmp# My idea is alias of username, so i tried reuse the same uid to create a new user: ...
1
vote
2answers
10k views

Trying to add user to group that exists in /etc/group not working

I'm trying to add a list of users to different groups on a debian VM. I am using the following sequence of commands in my bash script: getent group $uid || groupadd $uid #add ...
1
vote
2answers
1k views

Arch with XFCE & SDDM: New user doesn't get a full desktop environment… Why?

Intro Okay, this question was initially posted with hints that /etc/skel might be part of the issue. I have since removed the contents of /etc/skel, tried again and the issue still persists. As I ...
3
votes
1answer
4k views

usermod to change user password is not working

I have created user using below command useradd myuser Then, I tried to do change password with following command usermod --password mypwd myuser (I know plain password is not a good way, but for ...
0
votes
1answer
117 views

Can We Input Return Using Shell Scripts? [duplicate]

I want to use adduser USER (USER is a user name), but this asks me many questions like full name and address. I want a script which types the return key automatically and skip those questions. For ...
0
votes
1answer
910 views

useradd Does Not Create a Group in SUSE

I maintain a package that is built for debian, RedHat, and SUSE Linux distributions. Part of the post install script follows: /usr/sbin/useradd -r -d /var/opt/CampbellSci/LoggerNet loggernet This ...
1
vote
1answer
485 views

Unable to add or delete users

I'm currently having issues running adding, deleting and modifying Linux users. Reasonably new to Linux so pretty sure I have tried everything to resolve this. [root@device01 /]# useradd testuser ...
1
vote
0answers
858 views

How to test new user login?

I've done some searching on Google and SE and have not found what I need using my search terms. Accessing RHEL 5.10 (Tikanga) from Windows 7. I am making a new user and need to make sure their ...
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 ...
1
vote
0answers
20 views

Unable to log in after creating a user [duplicate]

I have an install script that creates a user: sudo useradd -c "My test user" -G users -m -p "passw0rd$" -K PASS_MAX_DAYS=-1 -s /bin/bash myuser However when I try to log in via ssh I get the ...
4
votes
1answer
14k views

Can't add user because group already exists?

I initially added a user (adduser MYUSER) and then deleted it (deluser MYUSER). Now I'm trying to add it again (adduser MYUSER) and I get the following message: adduser: The group 'MYUSER' already ...
2
votes
1answer
716 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 ...
1
vote
3answers
488 views

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 ...
1
vote
2answers
9k views

Skeleton directory - how to add my own directories

I want to add a few directories to the skeleton directory. When I add new user I want to add my own directories to the new home directories.
20
votes
1answer
1k views

Why is /etc/shadow shortening the password that I've set with the command: useradd -p?

[root@P-dude dude]# useradd -p $6$Ic2PVlwi$2nf.IRWTMy0FHrPzaCjkahfu9IIxnzxPZL7yg8SsvOdbjEpoI0G8uy7AqduYKQOn2R/rnnaalRmfPMy.a0 bwong20 [root@P-dude dude]# cat /etc/shadow | grep pswayze pswayze:nf....
3
votes
1answer
147 views

Can I make it so that all new users created in the future will have an expired password by default? [duplicate]

I want to make it so that every time anyone creates a new user on my system that user will be forced to set a password during their first login. I can't find anything in /etc/login.defs that will do ...
0
votes
0answers
56 views

useradd failing [duplicate]

Debian 8, I'm trying to allow a user to run Wireshark. user1@system:~$ sudo useradd -G wireshark user11 useradd: user 'user11' already exists However: user11@system:~$ groups user11 cdrom floppy ...
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: ...
-1
votes
1answer
103 views

processes that run during new user creation

I have two questions: What processes typically run when a new user is created? What processes run when an existing (regular) user escalates his privileges to gain root-access? I Googled a lot and ...
1
vote
0answers
352 views

Change default group for any new user

I'm wondering if you could change defaults groups for new users without having to specify all of them manually. I'm trying to harden my ArchLinux and there's a group (provided by Grsecurity) that is ...
1
vote
1answer
934 views

How to add 100 users from a file [duplicate]

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 ...
0
votes
0answers
263 views

SHELL definition in /etc/default/useradd has no effect [duplicate]

I'm running Ubuntu 14.04 via Vagrant. Within /etc/default/useradd, I've defined the SHELL setting to be /bin/bash. useradd -D reflects this setting, however it doesn't honor the setting when ...
4
votes
2answers
5k views

Change user maildir to custom location upon creation of the user

I use Ubuntu 14.04.3 LTS . How to change the location of the Mailbox /home/user/Maildir/ to /Location/Mail/? I don't have to create home directory for that user. I did some changes in the /etc/...
1
vote
1answer
50 views

Is there any backward compatibility of -p (--path) option in user/group commands?

I upgraded from SUSE SLES 11 to SLES 12 and found that some user/group commands (such as useradd, groupadd, groupmod ... ) are no longer accept -p (--path) option to specific the directory of passwd, ...
3
votes
1answer
123 views

Creating new users via terminal does not assign correct permissions?

I am creating a new user for a Linux Debian distribution. I did use the command to create a new user via terminal, while I was logged in as root; tehn assigned the user to the sudo group, so I can ...
2
votes
1answer
4k views

Home directory for system users

What is the best practice when setting the home directory of system users that don't have a specific working directory. I often have to create users to run specific binaries or scripts. Supposing ...
1
vote
1answer
381 views

How to add users and add them to groups in linux bash

sudo adduser –G {teacher} user sudo adduser –G {teacher} user How could I fix this if user is an input variable and teacher is an existing group?
0
votes
1answer
555 views

useradd cannot execute / not owner error

I have Solaris 9. When running useradd as root i have this error. #/usr/sbin/useradd ksh: /usr/sbin/useradd : cannot exceute Then tried change shell csh and sh but to no avail. csh: # /usr/sbin/...
1
vote
0answers
61 views

User creation during authentication

I'm working with OpenBSD 5.6 and the goal is that I need to create user when he or she tries to authenticate with specific password. I've written a script for this purpose and everything goes ok but ...
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 ...
1
vote
1answer
3k views

How to delete an user account with terminal

I created a new account on my Linux OS, using the useradd command, now I want to delete the account created, I'm trying to use the userdel command to delete that account and I get the following error: ...
3
votes
1answer
2k views

Can't add users anymore by using useradd

Whenever I do # useradd -N --gid 1003 -s /bin/ksh --uid <some UID starting with 10027> --home /home/<someuser> <someuser> useradd just refuses to add any user and prints instead: ...
3
votes
1answer
915 views

delete user with non unique id

I created a user with non unique id passing -o -u 1000 -m option to useradd command. So now I have two users with same id but with different names and different home directories. I thought that this ...
1
vote
1answer
452 views

Lock down certain files

I want to be able to lock down files to be only executed and not editable unless root access is granted to the user. I have a file called 'server.properties' and I would like to make it so that only ...
6
votes
2answers
2k views

Can not create SFTP user Debian 7

I have a linode and I access via ssh throw terminal. I need to create an sftp user which his default directory (and the only he can access) is /var/www/xxxxxx.com/public_html/directory Now, I did it, ...
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 ...
1
vote
2answers
270 views

How to bulk add disabled-password users?

Doing: # newusers username::1002:1002::/home/username:/bin/bash ^D No password supplied No password supplied No password supplied newusers: (user username) pam_chauthtok() failed, error: ...
0
votes
2answers
2k views

How to add “system” local user like mysql or tomcat?

My system has a lot of users, I'v never created, like mysql or tomcat. These users have no home directories inside /home Obviously, a daemon programs run under these users. What is the term for such ...
3
votes
1answer
524 views

added username, user unable to write to home directory

I added several users to my server using useradd -d /home/<username> <username> . The users are able to log in and access their directories, but get Permission denied error messages when ...
0
votes
1answer
571 views

RBAC user cannot execute useradd on Solaris 10

I am trying to create a user in Solaris 10 using RBAC who can execute the useradd and userdel commands. But for some reasons after i create the profile, role and user, this user gets a permission ...
0
votes
0answers
448 views

Added new user, but can't access account - public key encryption

I added a new user to one of our servers, but can't log in to it via putty. The error message is "Server refused our key", and from putty, "Disconnected: no supported authentication methods available (...
3
votes
2answers
2k views

Can I log in into a system user after I create him?

On an Ubuntu machine, if I run the following command: adduser --system --no-create-home system-user I create a system user named system-user without home directory with /bin/false as the shell. This ...