Adding new user in Linux - useradd and adduser not working

I'm trying to create a new user on my Web server.  I think it's running Ubuntu but I'm not sure.  I've tried useradd and adduser, while working as root, and it keeps telling me "bash: useradd: command not found"

I'm using putty to remote in to the server.

The man pages have information on the useradd command, even if the command doesn't seem to work.

What am I doing wrong?
GlennSimpson2Asked:
Who is Participating?
 
legolasthehansyConnect With a Mentor Commented:
Ok. Try su - (provided you know the password for root)
0
 
legolasthehansyCommented:
Are you root?
What is the output for command "id"?
0
 
GlennSimpson2Author Commented:
uid=0(root) gid=0(root) groups=0(root),1(bin),2(daemon),3(sys),4(adm),6(disk),10(wheel)
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
legolasthehansyCommented:
Great..
What about "which useradd" or "which adduser"
0
 
GlennSimpson2Author Commented:
which useradd

/usr/bin/which: no useradd in (/usr/kerberos/sbin:/usr/kerberos/bin:/user/local/bin:/bin:/usr/bin:/home/username/bin)

which adduser
/usr/bin/which: no adduser in (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/usersname/bin)
0
 
legolasthehansyCommented:
Ok. It looks like you logged in without loading the environment variables and PATH for root.

CAn you open a new terminal.
login as user (whoever)
Do sudo su - (Dont forget the - or hyphen after su)
Now try which useradd and see if you are able to run useradd
0
 
farzanjCommented:
Did you do

sudo su -

To get to super user?  Make sure not to forget this hyphen at the end
Then issue command

useradd newuser

or
useradd -g group -s /bin/bash newuser
0
 
GlennSimpson2Author Commented:
Here's what's happening.

Log in as user (say jsmith)

sudo su -
[sudo] password for jsmith: (i enter correct password)
jsmith is not in the sudoers file. This incident will be reported.

In this case "jsmith" is the guy who usually manages this server, so I'm not sure what that means.
0
 
woolmilkporcCommented:
Why not just

/usr/sbin/useradd ...

?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.