LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 10-07-2003, 07:01 AM   #1
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Rep: Reputation: 15
Question Groupadd and useradd for RH 8.0 ???


Hi

Any idea why I can't use the command useradd or groupadd ? Executing it and it says command not found.

Please advice and let me know how I can use it. Thanks!

Regards
Edward Han
 
Old 10-07-2003, 07:21 AM   #2
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
proably
/usr/sbin/useradd
/usr/sbin/groupadd
 
Old 10-07-2003, 07:21 AM   #3
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
If you logged in initially as root it's location is not in your path

If you used

su
password

do

su -
password

either way it's probably in /usr/sbin/groupadd

or

/sbin/groupadd

whatever works
 
Old 10-07-2003, 07:28 AM   #4
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
hi

It is in the path /usr/sbin/groupadd

but when execute, it says command not found. I am logon as root.

Same goes with useradd. It says command not found also.

How can I activate both the command?

Any idea?

Edward Han

Last edited by edhan; 10-07-2003 at 07:32 AM.
 
Old 10-07-2003, 07:55 AM   #5
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
The command is actually adduser not useradd.
 
Old 10-07-2003, 08:08 AM   #6
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi

Tried adduser and addgroup, it still says command not found.

Regards
Edward Han
 
Old 10-07-2003, 08:33 AM   #7
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
Works for me. It might not be in your path variable. Type find / -iname adduser at the prompt as root. If nothing comes up then that's bizarre and quite possibly not healthy. I don't use RH and I know it's different but that's a core linux/unix command. Ignore any hits you get that are in a directory called "doc". That's all documentation. On my computer it's in /usr/sbin.
 
Old 10-07-2003, 08:43 AM   #8
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi

Mine is useradd and groupadd are in the path /usr/sbin/ but not adduser or addgroup.

But I do not know why it says command not found when executing.

Regards
Edward Han
 
Old 10-07-2003, 09:27 AM   #9
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
just as a test

log in as root then type either the full way or using su

export PATH=/usr/sbin:$PATH


try

useradd or groupadd

again
 
Old 10-07-2003, 09:32 AM   #10
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
OK go to the directory and type ls -l *add. Check to see if they have executable permissions. If so then type ./useradd from that directory. Also, double check your path variable. Type echo $PATH and see if /usr/sbin is among the output.

Last edited by adz; 10-07-2003 at 09:34 AM.
 
Old 10-07-2003, 06:27 PM   #11
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi adz

The rights is okay. When trying ./useradd, it shows the command. When echo $PATH, it is not in the path. How do I add its path?

Thanks!

Regards
Edward Han
 
Old 10-07-2003, 09:19 PM   #12
adz
Senior Member
 
Registered: Jun 2003
Location: Sydney
Distribution: Debian, FreeBSD
Posts: 1,713

Rep: Reputation: 53
It shows the command? You mean it runs/executes it? Well that should fix your adding user probs. To add /usr/sbin to your PATH variable use the command that Looking_Lost suggested: export PATH=/usr/sbin:$PATH. That just adds /usr/sbin to the PATH variable without overwriting any of the previous entries. To get this every time on boot just add that line to one of the startup scripts. The problem is that you just want to add it to root's one and not to everyone's. I'm not entirely sure how to do that.
 
Old 10-07-2003, 11:08 PM   #13
edhan
Member
 
Registered: Sep 2003
Location: Singapore
Distribution: Redhat 8.0
Posts: 93

Original Poster
Rep: Reputation: 15
Hi

Okay. Your instruction works when I execute export PATH=/usr/sbin:$PATH

Thanks!

Regards
Edward Han
 
  


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
groupadd and perl-cgi server-solution Linux - Software 4 12-04-2005 04:51 PM
usermod and groupadd meDream Linux - Newbie 0 10-05-2005 05:01 AM
groupadd and useradd bash commands ph0ngwh0ng Linux - Newbie 1 04-28-2004 11:42 AM
groupadd Pedroski Linux - General 3 11-08-2003 11:58 PM
case sensitive groupadd? sysmaster Linux - General 0 07-28-2003 04:53 AM

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

All times are GMT -5. The time now is 08:53 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