Red HatThis forum is for the discussion of Red Hat Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
if you dont get the usage: useradd then your program might be broken, have you tried goala's answer?
if you are at the command line as yourself then you will get that error message, type "su -" and it will ask for a password type in the root password and then try typing useradd etc im sure it will work,
I've tried Goala's answer by puting ./ before the command and it works fine.
Also I edited /home/root/.bash_profile file, added the line: PATH=$PATH:/usr/sbin, it works fine, thanks guys
I have another question:
What is the difference between [su] and [su -] because I have to execute [su -] to be able to use useradd?
but if I execute [su] and then execute the command useradd it gives me: Command not found
I told you about putting ./ infront of the command which by the way still wouldnt have worked unless you were as root, as for your second question, su just emulates a user login but doesnt set up all the profiles, su - however is just like logging in on a terminal, it set up all the profiles and permissions, i pulled this info from an old unix manual.
cmd, you only connect as that user (or root if no user specified), but you retain your original env settings. Adding the '-' gives you the target user's settings, exactly as if you had logged in as him/her ie