useradd & groupadd commands not found


Results 1 to 13 of 13

Thread: useradd & groupadd commands not found

  1. #1
    Join Date
    May 2001
    Location
    portland
    Posts
    100

    useradd & groupadd commands not found

    redhat 9.0 isn't finding the
    $ groupadd

    or

    $ useradd commands

    I'm trying to instal MySQL

  2. #2
    Join Date
    Aug 2002
    Location
    Delaware
    Posts
    4,310
    check path, and make sure that you are root.
    irc.freenode.net #justlinux The Not So Official JL IRC Channel.
    Debian Apt-Get

  3. #3
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,221
    Those commands need root permission. su -

    Edit: People keep posting 2-3 mins before me
    Last edited by serz; 07-11-2003 at 03:36 PM.
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

  4. #4
    Join Date
    Dec 1999
    Location
    Toronto
    Posts
    39,329
    The '$' prompt would indicate you are attempting these system administration commands as user and not as root.

    You need to be root or equivalent in order to perform most the the Linux/Unix system administration functions.

    su -
    <root password>

    groupadd
    or
    useradd

    Type 'exit' to exit from 'su -' when done.
    SEARCH FIRST... ASK SECOND Read the JL 'Community Help Posting Guidelines' before posting in the forums.

    Precompiled Redhat NTFS Modules

    Linuxplanet Tutorials

    If Linux doesn't have the solution, you have the wrong problem. ... Please do not send me a PM asking for help...

    Please read the search suggestion thread in JL Ideas

  5. #5
    Join Date
    Jun 2003
    Location
    Silicon Valley, USA
    Posts
    190
    It's not normally in the path for ordinary users. You can find the system binaries in /sbin or /usr/sbin. A simple $ locate groupadd or $ find / -name groupadd would do the trick. Also you can view the man page. On some distros that will show you where to find the file.

    Like the above people said, you need root privilages to run the command, but you don't necessarily need su root. You could do it by executing sudo, for example.
    chort, CISSP

  6. #6
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,221
    Originally posted by chort
    you don't necessarily need su root. You could do it by executing sudo, for example.
    I don't know if that would work. He would still need permission to write to /etc/passwd. I might be wrong.
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

  7. #7
    Join Date
    Aug 2002
    Location
    Cayman Islands
    Posts
    681
    sudo grants the user full root permissions for running a single command. If it's allowed by the configuration file /etc/sudoers, then

    sudo useradd elmerfudd

    will run with full root privileges only for that command. It's like an ultraconfigurable superflexible SETUID. Very very cool.
    Scotty: Captain, we din' can reference it!
    Kirk: Analysis, Mr. Spock?
    Spock: Captain, it doesn't appear in the symbol table.
    Kirk: Then it's of external origin?
    Spock: Affirmative.
    Kirk: Mr. Sulu, go to pass two.
    Sulu: Aye aye, sir, going to pass two.

  8. #8
    Join Date
    May 2001
    Location
    portland
    Posts
    100
    errr, it turns out I was in root anyway... [i had to su to cp into usr/local]

  9. #9
    Join Date
    May 2001
    Location
    portland
    Posts
    100
    got it!

    i had to do
    locate groupadd
    /usr/sbin/groupadd mysql
    .....

    thanks!

  10. #10
    Join Date
    Apr 2003
    Location
    Buenos Aires, Argentina
    Posts
    4,221
    Originally posted by sploo22
    sudo grants the user full root permissions for running a single command. If it's allowed by the configuration file /etc/sudoers, then

    sudo useradd elmerfudd

    will run with full root privileges only for that command. It's like an ultraconfigurable superflexible SETUID. Very very cool.
    I was wrong then hehe. I never used sudo myself, but yea.. I've heard that it's fully configurable.
    djserz.com.ar
    "All the drugs in this world won't save you from yourself..."

  11. #11
    Join Date
    Aug 2002
    Location
    Delaware
    Posts
    4,310
    Originally posted by toypiano
    got it!

    i had to do
    locate groupadd
    /usr/sbin/groupadd mysql
    .....

    thanks!
    then your path is probably screwed up on ya... you shouldn't need to write out the path of /usr/sbin. try doing a groupadd by running "su -" to become root, or simply logging in as root at console.
    irc.freenode.net #justlinux The Not So Official JL IRC Channel.
    Debian Apt-Get

  12. #12
    Join Date
    Dec 1999
    Location
    Toronto
    Posts
    39,329
    And the su manpage (man su) explains the difference between 'su' and 'su -'.
    SEARCH FIRST... ASK SECOND Read the JL 'Community Help Posting Guidelines' before posting in the forums.

    Precompiled Redhat NTFS Modules

    Linuxplanet Tutorials

    If Linux doesn't have the solution, you have the wrong problem. ... Please do not send me a PM asking for help...

    Please read the search suggestion thread in JL Ideas

  13. #13
    Join Date
    Apr 2013
    Posts
    1

    Talking useradd and groupadd command requires root access

    Useradd and groupadd command always need root access to execute it. In ubuntu, if you have should have sudo root access and then only you can add user or group in system.

    To get sudo root access in ubuntu, we need to change the group of that user to sudo by some other account who have root access.

    difference between su and su - is that -- if you do only su to login then that time login process will not call login scripts of that user. i.e. user will not run with all its default parameter or anyother extra settings. if you do su - then it will call login scripts and while logging in. and that will be better to avoid errors while running commands or scripts.

    You will get detailed knowldge about this commands on below link :
    http://roundoverlinux.blogspot.in/20...-examples.html
    http://roundoverlinux.blogspot.in/20...-examples.html
    http://roundoverlinux.blogspot.in/20...-examples.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •