LinuxQuestions.org
Review your favorite Linux distribution.
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 06-18-2012, 06:08 PM   #1
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Rep: Reputation: Disabled
Unable to create user


Hell:

It seems like I'm unable to create a user to login even I'm in root mode

useradd test1
bash: adduser: command not found

adduser test1
bash: adduser: command not found

Any ideas why I can't create a user in root mode?
 
Old 06-18-2012, 06:19 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by hiep.pham View Post
Hell:

It seems like I'm unable to create a user to login even I'm in root mode

useradd test1
bash: adduser: command not found

adduser test1
bash: adduser: command not found

Any ideas why I can't create a user in root mode?
What OS are you using?

Your $PATH would be the first thing I'd check

Code:
echo $PATH
Next I'd just start looking

Code:
find / -type f -name '*useradd*'
-C
 
Old 06-18-2012, 06:22 PM   #3
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
CentOS release 5.5 (Final)

when I do $PATH and this is what I got

/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/home/pham/bin
 
Old 06-18-2012, 06:52 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
OK go into /usr/sbin and do a search there; I'm looking at a RHEL5 system and the cmds are in there.

Code:
lrwxrwxrwx 1 root root        7 Jun 28  2008 adduser -> useradd
-rwxr-xr-x 1 root root    36504 Jan 17  2007 newusers
-rwxr-x--- 1 root root    74512 Jan 17  2007 useradd
-rwxr-x--- 1 root root    49548 Jan 17  2007 userdel
-rwxr-x--- 1 root root    74416 Jan 17  2007 usermod
PS looks like they are part of the shadow-utils pkg; try
Code:
yum provides useradd

Last edited by chrism01; 06-18-2012 at 06:55 PM.
 
Old 06-18-2012, 06:56 PM   #5
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
[pham@ftp ~]$ ll /home
total 40
drwxr-x--- 2 root root 4096 Jun 18 13:30 ftp-docs
drwx------ 2 10001 10001 4096 Jun 20 2011 gorf
drwx------ 2 jmx_infra jmx_infra 4096 Jun 30 2011 jmx_infra
drwx------ 4 pham pham 4096 Jul 8 2011 pham
drwx------ 2 toor toor 4096 Jun 18 2011 toor


Sorry I did not see anything like useradd or adduser. I though I can add user from root command. Any special command should I use in order to add a new user?
 
Old 06-18-2012, 07:03 PM   #6
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by hiep.pham View Post
CentOS release 5.5 (Final)

when I do $PATH and this is what I got

/usr/kerberos/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin:/home/pham/bin
Did you run this command?

Code:
find / -type f -name '*useradd*'
Or the command that chrism01 suggested?

-C
 
Old 06-18-2012, 07:09 PM   #7
ohlookpie
LQ Newbie
 
Registered: Apr 2012
Posts: 20

Rep: Reputation: Disabled
What is the output from the following:

Quote:
ls -li /usr/sbin/useradd
ls -li /usr/sbin/adduser
/usr/sbin/adduser is a softlink pointing to /usr/sbin/useradd, so really not sure why your system is saying the adduser command is missing.
 
Old 06-18-2012, 07:09 PM   #8
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
[root@ftp pham]# yum provides useradd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.eecs.wsu.edu
* extras: mirrors.cat.pdx.edu
* updates: mirrors.syringanetworks.net
Warning: 3.0.x versions of yum would erroneously match against filenames.
You can use "*/useradd" and/or "*bin/useradd" to get that behaviour
No Matches found
 
Old 06-18-2012, 07:10 PM   #9
ohlookpie
LQ Newbie
 
Registered: Apr 2012
Posts: 20

Rep: Reputation: Disabled
Quote:
Originally Posted by hiep.pham View Post
[root@ftp pham]# yum provides useradd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.eecs.wsu.edu
* extras: mirrors.cat.pdx.edu
* updates: mirrors.syringanetworks.net
Warning: 3.0.x versions of yum would erroneously match against filenames.
You can use "*/useradd" and/or "*bin/useradd" to get that behaviour
No Matches found
Do a yum provides "*/useradd" as the output that you've posted suggests.
 
Old 06-18-2012, 07:12 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,356

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
You still haven't checked the/usr/sbin dir as suggested (twice)
 
Old 06-18-2012, 07:15 PM   #11
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
[root@ftp pham]# /usr/sbin/useradd gorf4
[root@ftp pham]#

but it doesn prompt to setup a new password. Am I missing something here?
 
Old 06-18-2012, 07:17 PM   #12
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,977
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
Quote:
Originally Posted by hiep.pham View Post
[root@ftp pham]# /usr/sbin/useradd gorf4
[root@ftp pham]#

but it doesn prompt to setup a new password. Am I missing something here?

To change the password, you need to use the "passwd" command

Code:
/usr/bin/passwd gorf4
--C
 
Old 06-18-2012, 07:22 PM   #13
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
Thanks it worked.
 
Old 06-18-2012, 07:40 PM   #14
hiep.pham
Member
 
Registered: Jun 2012
Posts: 54

Original Poster
Rep: Reputation: Disabled
Sorry I have another questions how can I reset proftpd user password?
 
  


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
Unable to create a new user in Directory Server naman.jandial Linux - Server 4 07-16-2010 05:30 PM
[SOLVED] SLES 10 SP2 unable to create a new user from YAST linuzHX SUSE / openSUSE 4 03-20-2010 12:45 AM
i am unable to load mappingtable by using dmsetup and unable to create vitualdevice varunsharma35 Linux - Software 0 12-20-2008 08:52 AM
Unable to create new postgres user..! crash_override_me Linux - Server 2 06-06-2007 04:18 PM
Unable to create directory as user technician Slackware 4 02-15-2004 01:28 AM


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