LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-10-2019, 10:31 AM   #1
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Rep: Reputation: Disabled
Issue adding user


Hi I am trying to set up a webserver from scratch on a virtual server at work, but something odd is happening while trying to add a user, if I use:
Code:
useradd --system --gid webapps --shell /bin/bash --home /webapps/django_user pcc_update
it adds the user, but is using another account's home. If I use?
Code:
adduser --system --gid webapps --shell /bin/bash --home /webapps/django_user pcc_update
I get the following error:
Code:
Value "webapps" invalid for option gid (number expected)
Digging further, webapps is a group that I set up and shows up as:
Code:
webapps:x:999:
I'm a little out of my depth here, if it helps, this is the article I am following, http://michal.karzynski.pl/blog/2013...nv-supervisor/

I could just set up this site on root, but I am trying to learn good practice and would like to understand where I am going wrong.
 
Old 01-10-2019, 11:52 AM   #2
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Try:

Code:
useradd -d /webapps/django_user -m
Flag -d tells to use /webapps/django_user as home directory and -m will create the directory and set correct permissions.

Review man page for useradd command; it has good info.
 
Old 01-10-2019, 06:49 PM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Well, on RHEL/Centos 7 --gid can be name or number, according to the man pages.

Maybe you should check the man pages on your actual system.
You could post the distro name/ver here as well.
 
Old 01-11-2019, 12:25 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by iFunction View Post
Code:
Value "webapps" invalid for option gid (number expected)
Digging further, webapps is a group that I set up and shows up as:
Code:
webapps:x:999:
why don't you just try 999 then?
 
Old 01-11-2019, 04:51 AM   #5
iFunction
Member
 
Registered: Nov 2015
Posts: 248

Original Poster
Rep: Reputation: Disabled
Thank you all for your input, I found out the issue, I was setting this all up under my user account (which is an admin account). I started again as root and this solved all the problems. A bit of a newby fail really but logically it should be root as this is basic first level setup before the system is even being used.

I consider this issue SOLVED, but I always appreciate feedback on my finding to keep the information accurate.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete current user and dir, adding new user green ice Linux - Newbie 7 09-21-2015 05:26 AM
Bash script for adding users is running but not adding users Gren Programming 2 04-27-2012 03:53 AM
[SOLVED] Adding a new user to Solaris 9 so that this user can ssh into the server rcforster Solaris / OpenSolaris 2 03-14-2011 06:10 AM
Adding more SWAP after adding memory marc1978 Linux - General 6 03-19-2006 07:13 PM
Shorten a Qmail user name to "user" instead of "user@domain.com" anorman Linux - Software 0 12-12-2003 08:29 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration