adding user from command line

If it doesn't fit in another category, ask it here.
thecoolone
Posts: 5
Joined: 2006/11/24 08:44:29

adding user from command line

Postby thecoolone » 2006/11/24 08:56:28

I tried to add a new user using the command line commands "useradd" and "adduser" but with no luck. The user names are added but i cannot login into the system using the just created username and password. Whats wrong?? y isint it working??
And also i wanted to know that when i login as a regular user and then use "su" in the terminal and then as root in the terminal try to do "adduser" command it says "bash command not found". why does this happen. im a superuser in the terminal and y cant i execute the "adduser" command.

And finally i would like to know if there is a way to manually add a user in the centos remotely from the command line. This is very important to me right now.

any advice is welcomed.

thanx in advance

K_Frye
Posts: 425
Joined: 2005/07/13 01:48:35
Location: Canada

adding user from command line

Postby K_Frye » 2006/11/24 13:58:55

thecoolone wrote:
I tried to add a new user using the command line commands "useradd" and "adduser" but with no luck. The user names are added but i cannot login into the system using the just created username and password. Whats wrong?? y isint it working??


http://www.centos.org/docs/4/html/rhel- ... -line.html

Look closely at the two steps described in section 33.5.1.

And also i wanted to know that when i login as a regular user and then use "su" in the terminal and then as root in the terminal try to do "adduser" command it says "bash command not found". why does this happen. im a superuser in the terminal and y cant i execute the "adduser" command.


It's all about the path. Use "su -" instead of just "su".

And finally i would like to know if there is a way to manually add a user in the centos remotely from the command line.


Of course. See the above link.

albertsk
Posts: 1
Joined: 2008/11/07 06:36:03

Re: adding user from command line

Postby albertsk » 2008/11/07 06:39:33

It took a few minutes to find out the location of "adduser". Here we go.

[color=FF0000][font=Georgia]/usr/sbin/adduser[/font][/color]


:lol:

User avatar
AlanBartlett
Forum Moderator
Posts: 9311
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact:

Re: adding user from command line

Postby AlanBartlett » 2008/11/07 13:49:59

To the OP -- please check the CentOS wiki. It's a valuable resource. Assuming root powers.

User avatar
toracat
Forum Moderator
Posts: 7230
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: adding user from command line

Postby toracat » 2008/11/07 15:51:59

And also i wanted to know that when i login as a regular user and then use "su" in the terminal and then as root in the terminal try to do "adduser" command it says "bash command not found". why does this happen. im a superuser in the terminal and y cant i execute the "adduser" command.


It's all about the path. Use "su -" instead of just "su".

For this, I'd like to refer the OP to:

http://wiki.centos.org/TipsAndTricks/BecomingRoot

scottro
Forum Moderator
Posts: 2336
Joined: 2007/09/03 21:18:09
Location: NYC
Contact:

Re: adding user from command line

Postby scottro » 2008/11/08 13:14:35

I have my own page on this, as it's such a frequent question on Fedora forums

http://home.nyc.rr.com/computertaijutsu/rhpath.html

(On the other hand, I think most of the info is already given in the provided links--but I hate to be left out). :)