Questions tagged [useradd]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
37 views

Cannot append user to group

I'm having trouble adding a user to a group: # useradd -aG group user # useradd -a -G group user # useradd -G group user --append It tells me that the -a option is an invalid or unrecognized. Can ...
user avatar
  • 998
0 votes
0 answers
40 views

Adding an SSH/Bash user in vSphere 7.0 PhotonOS

I'd like to start off by saying that I am by no means a Linux expert. My experience in the past is very limited, so please be patient. I recently started a new job and was given the task of hardening ...
user avatar
  • 1
4 votes
1 answer
537 views

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 ...
user avatar
  • 149
0 votes
1 answer
42 views

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 ...
user avatar
  • 1
0 votes
1 answer
313 views

Change default login user for Linux from root

I've been working with Linux for awhile and was wondering how I could go about changing the default login user. The whole time I've used Ubuntu, I've been logging in as the root node, as bad as that ...
user avatar
  • 11
-1 votes
1 answer
88 views

useradd: group '9001' does not exist

i am trying to run the command: root@minimanode:/# sudo wget -O minima_setup.sh https://raw.githubusercontent.com/minima-global/Minima/master/scripts/minima_setup.sh && chmod +x minima_setup....
user avatar
2 votes
1 answer
107 views

How to set maximum number of users in Linux?

For example, let's say that I want a maximum of 3 users. How can I make sure that no more than 3 users can be created?
user avatar
  • 261
0 votes
1 answer
103 views

debian (?) - create new user based off of an existing one (copying configs, apps, etc)

What I want to achieve: Use an established user to create multiple new users each of which with identical starting set ups, same applications (e.g. Slack), same configurations (e.g. conda installed ...
user avatar
  • 173
1 vote
1 answer
101 views

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:...
user avatar
  • 33.3k
1 vote
1 answer
249 views

How to verify whether a user has a home directory or password?

Where can I find details on how a user was created. And what is the current status of a user. For example, adduser command can be run with --no-create-home, --disabled-password, --home DIR etc. Is ...
user avatar
  • 1,319
0 votes
1 answer
46 views

users command does not show recently added users

I have created few users: sudo useradd bart sudo useradd marge sudo useradd lisa sudo useradd maggie These users now exist $ awk -F: '{ print $1}' /etc/passwd blueray bart marge lisa maggie However ...
user avatar
  • 1,319
-1 votes
1 answer
671 views

Check If user exist in /etc/passwd, If exist create new one with prefix

Kinda stuck here, did not found any solutions. Check If user exist in /etc/passwd, If exist create new one with prefix new_the_existed_one #!/bin/bash myuser="/home/yakyak/Desktop/Exercises/...
user avatar
  • 11
0 votes
1 answer
312 views

useradd create a user without password and accessible only by ssh

I'm writing a script that automatically creates a user using the useradd command (I need this one and not adduser). I want to create it in a way that it is accessible only using ssh (the script ...
user avatar
-3 votes
1 answer
53 views

Creating users with modified home directory and mask [closed]

I need to create 6 new users (one, two, three, four, five and six) with passwords, two of these (five and six) must have their personal directories modified (using skelo or configuration files, I don'...
user avatar
  • 550
0 votes
0 answers
28 views

useradd and user management in Plasma

I added a user in the terminal useradd -m -g <groupID> -u <userID> <username> Now, going to the user management of KDE I tried to change the name of the account (NOT the user name), ...
user avatar
0 votes
0 answers
69 views

openssl passwd password only works briefly

I am having a strange issue setting up linux VM instances. Please forgive me if this is basic, I am not a linux systems programmer (usually). I am trying to script the launching of 20+ linux ...
user avatar
0 votes
1 answer
571 views

How to avoid getting "sudo: Account or password is expired, reset your password and try again"

I am trying to add user e.g. amit to group amit,as below. root# groupadd -g 1500 -f amit root# useradd amit -m -G sudo -u 1500 -g 1500 -o -p "amit" However, ...
user avatar
0 votes
1 answer
41 views

How to add user in Unix System 7?

I have created a Unix System 7 VM in VirtualBox following instructions by Robert Nordier. I have dropped to the single user prompt (#). I can run commands like ls and passwd and cat. However, useradd ...
user avatar
  • 111
0 votes
2 answers
72 views

Information of new user won´t show in terminal

I created a new user and logged in successfully on my ubuntu 20.04 machine. When I logged in as root the terminal looks like this: root@ubuntu-s-1vcpu-1gb-fra1-01:~# When I login with my "...
user avatar
0 votes
1 answer
50 views

Cross Distro way of creating a service user and group?

On Debian/Ubuntu systems I can use the following line to create a user and group named "dv" just for usage on a daemon service (systemd). No SSH login, no password, no home directory etc: ...
user avatar
0 votes
1 answer
380 views

How to add new Linux user restricted to ssh tunneling with password?

I wanted to create a new user on my linux server so that he can access my postgres database through an ssh tunnel. However, I want him to restrict his access only to the ssh tunnel. I followed these ...
user avatar
  • 101
-8 votes
2 answers
62 views

How Does Unix Interpret $? [closed]

[orca@orcacomputers public_html]$ adduser Jé$$è+rèè adduser: invalid user name 'Jé28956è+rèè' I am unable to use $ when adding users in CentOS7. Karen goes "WHY THE HELL WOULD YOU DO THAT!?&...
user avatar
0 votes
1 answer
541 views

Prompt string not set properly in Bash for new user

I'm using Kali Linux for one of my classes, and part of our first assignment is to create a custom user account using our names instead of the default kali login, however when I do this it messes with ...
user avatar
0 votes
0 answers
330 views

adduser: /etc/gshadow.: Structure needs cleaning

I am getting the following error when I try to add a new user sh-4.2$ sudo adduser mbyousaf adduser: /etc/gshadow.1341: Structure needs cleaning adduser: cannot lock /etc/gshadow; try again later. I ...
user avatar
0 votes
1 answer
331 views

Cannot add user with useradd command

I am on CentOS 8.2 and I'm unable to add an user using the useradd command [root@localhost ~]# useradd -m /home/alice -c "ALICE ADMIN" -s /usr/bin/bash alice Usage: useradd [options] LOGIN ...
user avatar
1 vote
1 answer
367 views

Getting a warning I don't understand when trying to useradd with m & d options

I'm trying to add a new user, "abc", with a home directory of "/test/abc", for him, using the useradd command on an Ubuntu machine as follows: useradd abc -md /test/abc and ...
user avatar
  • 11
0 votes
0 answers
76 views

When creating new users, how can I incorporarte a sh script to be executed in order to create custom files/directores for the new users?

I want to run a script with sudo privileges when a new user is added to my system. More specifically, whenever I create a new user (with useradd or adduser), I want to be able to create a folder ...
user avatar
-1 votes
1 answer
334 views

What is the point of a system user?

Ok so when you look at the system user the point of the system user is to run services with minimal permissions, and to have a user that doesn't have a password or ssh. The issue I have with this is ...
user avatar
0 votes
0 answers
48 views

How to create user which have permission only specific folders

I need to create user and give only permission to my site folder and apache config folder(read,write,shell).These user should have ssh connection.Can anyone help me please? Distro is Centos 7.
user avatar
0 votes
1 answer
726 views

Terminal returning: no crontab for user

I create a new user, john. Now I want to programmatically write a cronjob to the user john's crontab. #!/bin/bash #script name: cronbuild.sh cronjob1="0 */3 * * * /home/john/ad_dev/modem_dog.sh&...
user avatar
  • 67
0 votes
0 answers
32 views

Prevent deb installation from creating new accounts

We are configuring a variety of servers programmatically, and we periodically need to be able to migrate volumes from one server to another. After migrating a volume, we are currently executing chown ...
user avatar
  • 101
1 vote
0 answers
392 views

How can I set up my Linux server to permit password login for sftp only, and require public private key for ssh?

I have a Linux server which I have configured to login with public private key for my account - and it works well. It's a long time since I set it up, so I can't remember what steps I took - but it's ...
user avatar
1 vote
2 answers
1k views

User can't login in lightdm only root can

I've installed arch, and lighDM with awesome window manager. Everything runs okay.If I login as root, awesome load and works but if I login with the user I've created it attemps to log, clean te ...
user avatar
18 votes
3 answers
63k views

bash: adduser: command not found [Debian Buster]

Question: What is the most-ideal way to add new users in Debian? adduser appears to be missing on my system, any tips? Log: bash: adduser: command not found Edit: adduser does appear to be ...
user avatar
1 vote
1 answer
31 views

User Creation From Web Server

I'm creating a web app which will allow me to setup shared hosting environments. Everything has to be done programmatically and i'm questioning whether i'm approaching things in a completely insecure ...
user avatar
0 votes
1 answer
799 views

How create a folder owned by specific username & groupname?

In mac groupadd command does not work: After $ sudo mkdir -p /a/b, a$ ls -l total 0 drwxr-xr-x 2 root wheel 64 12 Jan 09:46 b a$ pwd /a a$ a$ a$ uname -a Darwin user01vl 18.7.0 Darwin Kernel ...
user avatar
  • 1,286
4 votes
1 answer
3k views

Using `useradd -R` for chrooting

If I got it right, chroot restricts user's access to a given directory only. Looks like useradd has this option (Debian 10). # useradd --help | grep "chroot" -R, --root CHROOT_DIR directory ...
user avatar
  • 489
0 votes
1 answer
73 views

Is there any difference between first user account and after then the account created?

When i first set up my linux desktop it asked me to add a user account . After then i was learning linux commands using this account. I then add some more users using "useradd" command. Now i eager ...
user avatar
0 votes
1 answer
230 views

useradd account cant login through GUI

I'm using KALI fresh install. Linux kali 5.2.0-kali2-686-pae #1 SMP Debian 5.2.9-2kali1 (2019-08-22) i686 GNU/Linux I created a user using useradd akkilah Then i added this user to sudo group ...
user avatar
  • 23
1 vote
1 answer
96 views

Create Unicode Login In *Unix

I want to create Unicode logins for *Unix flavor OS, when i use useradd like below, I got that user name is invalid [root@mail ~]# useradd ياسين useradd: invalid user name 'ياسين
user avatar
0 votes
2 answers
2k views

Add new user without password but not disabled

I need to add new users who are only supposed to be usable through SSH. When adding a user, they get added to the shadow file with an exclamation mark (!) instead of an asterisk (*), so they are "...
user avatar
  • 233
-2 votes
1 answer
240 views

Sudoers permissions to new user that only allow "useradd and usermod"

I want to create a new user and I want this user to be allowed to only run "useradd" and "usermod" Will I need to configure the sudoers file? Not sure how to go about this.
user avatar
3 votes
2 answers
1k views

Verbose useradd in Red Hat Enterprise Linux

I'm trying to output the result of "useradd" to a logfile, but unfortunately there is no verbose option. For example: "useradd dude" has no output, unless the user already exists. I would like to do ...
user avatar
  • 71
1 vote
0 answers
20 views

unable to boot directly to desktop environment

I tried to change a user's login name with usermod --login krypton maddybut now everytime I reboot my pc, it doesn't directly shows the desktop environment and I need to do Ctrl+Alt+F2 and then startx ...
user avatar
  • 31
2 votes
1 answer
86 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 ...
user avatar
  • 307
1 vote
1 answer
1k 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),...
user avatar
  • 53
7 votes
2 answers
2k 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?
user avatar
  • 223
3 votes
1 answer
743 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 ...
user avatar
  • 33
0 votes
2 answers
125 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 ...
user avatar
  • 27
2 votes
1 answer
77 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 ...
user avatar
  • 2,299

1
2 3 4 5