LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 10-19-2009, 05:48 PM   #1
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Rep: Reputation: 0
User Add


Hi,

I don't even know where to start here. A Linux project was turned over to me and as I started to dig around I noticed that I couldn't add user(s) by using useradd command. The command was not found. I basically at a lost here. I need to be able to add/ create user and assign them to group like admin group etc.

Can someone help me?

I did a cat /etc/issue and got the below...

Linux "SERVER NAME" 2.6.27.7 #1 SMP Thu Feb 19 12:04:52 GMT 2009 i686 GNU/Linux TOAK

Not sure what else to provide but please ask and I'll do my best to give more info.

Thanks in advance!!!
 
Old 10-19-2009, 05:50 PM   #2
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Did you try which useradd or whereis useradd? Chances are, it is just in a directory not in your path (probably /usr/sbin or /sbin). What is the output of echo $PATH?
 
Old 10-19-2009, 05:54 PM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
Also, make sure you add a new user as root.
 
Old 10-19-2009, 06:09 PM   #4
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pljvaldez View Post
Did you try which useradd or whereis useradd? Chances are, it is just in a directory not in your path (probably /usr/sbin or /sbin). What is the output of echo $PATH?
Yes, I went to the /usr/sbin or /sbin as well and unable to do it. Nothing there.

The output of echo $PATH:

/bin:/sbin:/usr/bin:/usr/sbin:/local/bin:/loca/sbin

Last edited by v890115; 10-19-2009 at 06:11 PM.
 
Old 10-19-2009, 06:22 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
What distro are you using there?
 
Old 10-19-2009, 06:24 PM   #6
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
You could try to find it manually:
Quote:
#find / -name useradd
 
Old 10-19-2009, 06:30 PM   #7
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by sycamorex View Post
You could try to find it manually:
I did try to find it manually too and came back with nothing. Not sure where else to look for.
 
Old 10-19-2009, 06:44 PM   #8
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
I've never tried it, but I would guess you can add a user by editing (as root) /etc/passwd, /etc/shadow, and /etc/group by hand. Then you'll want to run passwd after that to set a sane password and create a /home directory.

Also, a long time ago, I feel like I ran a distro that used adduser instead of useradd.
 
Old 10-19-2009, 06:49 PM   #9
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pljvaldez View Post
I've never tried it, but I would guess you can add a user by editing (as root) /etc/passwd, /etc/shadow, and /etc/group by hand. Then you'll want to run passwd after that to set a sane password and create a /home directory.

Also, a long time ago, I feel like I ran a distro that used adduser instead of useradd.
Thanks... I'll give that a try. It's been 3 yrs since I worked on Linux. I have tried adduser and useradd and both were not found. I can't help but to think utility is missing or someone removed the commands/ utility. Now, if that's the case how do I install it back? I am logging in as root, by the way. And even in root I can't find the useradd and/or adduser command.

Last edited by v890115; 10-19-2009 at 06:50 PM.
 
Old 10-19-2009, 06:51 PM   #10
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
Quote:
Originally Posted by pljvaldez View Post
I've never tried it, but I would guess you can add a user by editing (as root) /etc/passwd, /etc/shadow, and /etc/group by hand. Then you'll want to run passwd after that to set a sane password and create a /home directory.

Also, a long time ago, I feel like I ran a distro that used adduser instead of useradd.
I checked the adduser interactive script and it seems that it actually uses the useradd binary.
 
Old 10-19-2009, 06:52 PM   #11
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200Reputation: 1200
@v890115
You haven't answered the question about your distro yet.
 
Old 10-19-2009, 07:09 PM   #12
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Here's a guide to adding a user by hand.
 
Old 10-19-2009, 07:15 PM   #13
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,263

Rep: Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329Reputation: 2329
In re distro, also look for a file like

/etc/*release*


try

uname -a

as well.
 
Old 10-19-2009, 07:45 PM   #14
v890115
LQ Newbie
 
Registered: Oct 2009
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Tinkster View Post
What distro are you using there?
Oopss I missed this question earlier. Distro is Linux 2.6.27.7
 
Old 10-19-2009, 07:58 PM   #15
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
Quote:
Originally Posted by v890115 View Post
Oopss I missed this question earlier. Distro is Linux 2.6.27.7
That's not the distro. That's the linux kernel version. The distro will be something like Red Hat Enterprise Linux, or Ubuntu, or Debian, or Slackware, etc.

As someone else mentioned, try poking around for an /etc/*Release* file or something of the like that might tell us which distro and what vintage. Or uname -a output might give us some clues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't add local system user - useradd keeps saying user already exists ADeluiz Linux - Security 5 07-26-2013 04:17 PM
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 02:14 PM
samba - add user script - User account does not exist itzamecwp Linux - Server 2 01-18-2007 11:52 PM
How to automatically add smb user when unix user added Winanjaya Linux - Newbie 3 01-07-2007 12:17 PM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 10:59 AM


All times are GMT -5. The time now is 01:43 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration