User addition in Unix box

Hi All,

Am using the following command to add a user in Unix box

useradd -d <default_path> -g 90 -p <pwd for the user> <user_name>

But am getting an error while using this command by root user.Let me know if this cmd is right or else is there any other command to add a user in unix box.

The -p option is non-standard.

Usually you can add users with useradd, but you'll need to change/set the password manually or use a different tool for that.

The fact that you're using -p indicates maybe a Linux box? What error are you getting? I tried your command on a linux box and it seems to work just fine.

Version of unix/Linux?

Command actually submitted (with anything confidential X'd out) ?

Error message?

Contents of /etc/default/useradd ?

Notes:
If the home directory does not exist you might need "-m" (Create home directory) switch.
Some versions of "useradd" need a value in "-c" (comment). It's usual to put the users real name here.

Am getting the error "bash: useradd: command not found" after i give the command

useradd -d /home/jan -g 90 -p jan1123 jan

This is the content inside the etc/default/useradd file

# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel

It may not be in your path, try 'whereis useradd' to find out where the executable is. Then run it directly, specifying the full path(such as /usr/sbin/useradd)

Thanks for that as i found out the executable. But this time am getting the error

useradd: unknown group 90

The command i used is "/usr/sbin/useradd -d /home/jan -g 90 -p jan123 jan"

grep 90 /etc/group

If there is no output, then there really isn't any group 90.

Thanks i got my answer. Now i want to know how do i delete a user from unix box using root user?

man userdel
(Which is mentioned in "man useradd")

Got it... /usr/sbin/userdel -r <user>.....