Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
I get the above mentioned error when I try to add a user.
By trying
sudo useradd -u 1200 -g test -c 'studente' student
or
sudo useradd anyuser
I get
useradd: group '100' does not exist
useradd: the GROUP= configuration in /etc/default/useradd will be ignored
Content of /etc/default/useradd is
# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes
I must have messed up somewhere by creating, modifying and deleting users and groups but I don't know where.
You must have deleted the group 100 by accident.
On Fedora, group ID 100 is users. To solve that problem, all you have to do is create the group again:
groupadd -g 100 users
For more information about groupadd use man groupadd.
For more information about users and groups, check Fedora documentation Managing Users and Groups.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 4 years ago.
Improve this question
I've created a user in Ubuntu 16.04 using the commands
sudo useradd peris
sudo passwd peris
Then I log off, ans log in with the new user but I got this error:
Could not chdir to home directory /home/peris: No such file or directory
To automatically create the user's home directory you have to call:
sudo useradd -m peris
From now on, the best you can do is manually create the user's home directory using:
sudo mkdir /home/peris
And set the user's home directory so the system actually knows where to go. This can be done using:
sudo usermod -d /home/peris peris
Also, you want to make sure the said user has rights on his own folder. Use:
sudo chown peris:peris /home/peris
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 12 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I have 2 linux machines. On one machine these are the users:
sysadmin2:x:4201:4200::/home/sysadmin2:/bin/bash
appadmin1:x:4100:4100::/home/appadmin1:/bin/bash
appadmin2:x:4101:4100::/home/appadmin2:/bin/bash
dataadmin1:x:4300:4300::/home/dataadmin1:/bin/bash
dataadmin2:x:4301:4300::/home/dataadmin2:/bin/bash
sysadmin1:x:4200:4200::/home/sysadmin1:/bin/bash
I want to replicate these to another machine. How can I create these users with same uid and gid values? Is there a way I can copy them to another machine?
First, create the group if it doesn't exist:
$ groupadd -g 4200 sysadmin2
Next, create the user and add it to the group:
$ useradd sysadmin2 -u 4201 -g 4200 -m -s /bin/bash
$ useradd appadmin1 -u 4100 -g 4100 -m -s /bin/bash
and don't forget to reset password for each user.
In summary and in general, you can use the useradd command to add users to a linux system. The -u flag allows you to set a specific user id and the -g flag allows you to set a specific group id. Please see useradd's manpage for more details -- on a terminal, type man useradd to see it.
Now, specifically about your problem, see below.
Assumming you have three groups on your original machine:
$ cat /etc/group
...
appadmins:x:4100:
sysadmins:x:4200:
dataadmins:x:4300:
...
On your destination/new machine, you should first create the groups using:
groupadd appadmins -g4100
groupadd sysadmins -g4200
groupadd dataadmins -g4300
Then, you can proceed to create the actual users like so:
useradd appadmin1 -u4100 -g4100 -d/home/appadmin1 -s/bin/bash
useradd appadmin2 -u4101 -g4100 -d/home/appadmin1 -s/bin/bash
useradd sysadmin1 -u4200 -g4200 -d/home/sysadmin1 -s/bin/bash
useradd sysadmin2 -u4201 -g4200 -d/home/sysadmin2 -s/bin/bash
useradd dataadmin1 -u4300 -g4300 -d/home/dataadmin1 -s/bin/bash
useradd dataadmin2 -u4301 -g4300 -d/home/dataadmin2 -s/bin/bash
The -d option is used to set the home directory and the -s option is used to set the shell. Again, -u and -g are used to set a specific user and group id.
To check that everything went correctly, just use grep admin on your /etc/passwd file:
$ grep admin /etc/passwd
appadmin1:x:4100:4100::/home/appadmin1:/bin/bash
appadmin2:x:4101:4100::/home/appadmin1:/bin/bash
sysadmin1:x:4200:4200::/home/sysadmin1:/bin/bash
sysadmin2:x:4201:4200::/home/sysadmin2:/bin/bash
dataadmin1:x:4300:4300::/home/dataadmin1:/bin/bash
dataadmin2:x:4301:4300::/home/dataadmin2:/bin/bash
If something is wrong, you can use userdel or groupdel accordingly and start over.
The account configure files could be shared by any Linux machine in same privileges. you could make a copy to that machine to have a same user list by this command:
scp /etc/{passwd,shadow} root#your_marchine_IP_address:/etc/ -p
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have Linux VPS and few accounts there. I used SSH with root logins to copy files from one account to another (e.g. in this folder
/home/firstacc/public_html/forum I typed cp -R * /home/secondacc/public_html/community).
Now when I use regular FTP to edit files on secondacc - I can't modify it - SmartFTP says permission denied. Now how do change ownership or permissions so they can be edited via regular FTP ?
use chmod to set the permissions (but be careful not to allow any wild process to modify your files) and chown/chgrp to change ownership/group-membership of your file.
ideally you would create a group (i call it 'fancyhomepage') where both users are members thereof:
# addgroup fancyhomepage
# adduser firstacc fancyhomepage
# adduser secondacc fancyhomepage
then make sure that all files you want to share belong to this group and are group-writeable
$ chgrp -R fancyhomepage /home/secondacc/public_html/community/
$ chmod -R g+rwX /home/secondacc/public_html/community/
$ chown -R <user>:<org> on the directory changes the permissions for everything in the directory and below.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm a linux noob and I'm stuck on a small detail of a class assignment.
I meant to do this from a root shell:
useradd myname -g sudo -p 'openssl passwd -crypt abc123'
To create a sudoer account for me.
Messed it up the first time, so now it says the user already exists.
I want to make sure I'm in the sudoers group and that I know my password to SSH in.
The passwd command can't be used, nor the adduser command.
I know the useradd command is available, but not sure if I can use that somehow...
Ideas?
Edit: And how could I double-check that it worked?
Edit2: I don't have access to an editor like nano or vim :/
Why not just examine (or edit, given the required powers) the /etc/passwd, /etc/shadow, /etc/group and /etc/sudoers files?
Just about everything to do with standard security can be found there
To double check if it works, simply log in from another terminal and try.
Found a work-around:
userdel myname
useradd -m -g sudo -p `openssl passwd -1 abc123` myname
For some reason, I'm able to use sudo but am not in /etc/sudoers
#paxdiablo, thank you for the help!
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Here I have user and group with same name, while adding user(mqm) to the group(mqm) I am getting following problem. please give me solution.
[root#localhost /]# useradd -G mqm mqm
useradd: user 'mqm' already exist
useradd does not add a user to a group. It adds an user account to the system. You want to use usermod. See man usermod
How about groupadd?
root# groupadd -g GID mqm
Afterwards add user mqm to the group mqm.
See this here.