LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   User Add (https://www.linuxquestions.org/questions/linux-newbie-8/user-add-763042/)

v890115 10-19-2009 04:48 PM

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!!!

pljvaldez 10-19-2009 04:50 PM

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?

sycamorex 10-19-2009 04:54 PM

Also, make sure you add a new user as root.

v890115 10-19-2009 05:09 PM

Quote:

Originally Posted by pljvaldez (Post 3725348)
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

Tinkster 10-19-2009 05:22 PM

What distro are you using there?

sycamorex 10-19-2009 05:24 PM

You could try to find it manually:
Quote:

#find / -name useradd

v890115 10-19-2009 05:30 PM

Quote:

Originally Posted by sycamorex (Post 3725373)
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.

pljvaldez 10-19-2009 05:44 PM

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.

v890115 10-19-2009 05:49 PM

Quote:

Originally Posted by pljvaldez (Post 3725393)
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.

sycamorex 10-19-2009 05:51 PM

Quote:

Originally Posted by pljvaldez (Post 3725393)
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.

sycamorex 10-19-2009 05:52 PM

@v890115
You haven't answered the question about your distro yet.

pljvaldez 10-19-2009 06:09 PM

Here's a guide to adding a user by hand.

chrism01 10-19-2009 06:15 PM

In re distro, also look for a file like

/etc/*release*


try

uname -a

as well.

v890115 10-19-2009 06:45 PM

Quote:

Originally Posted by Tinkster (Post 3725371)
What distro are you using there?

Oopss I missed this question earlier. Distro is Linux 2.6.27.7

pljvaldez 10-19-2009 06:58 PM

Quote:

Originally Posted by v890115 (Post 3725443)
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.


All times are GMT -5. The time now is 08:38 PM.