Results 1 to 4 of 4

Thread: editing suduers

  1. #1
    Join Date
    Mar 2009
    Beans
    14

    editing suduers

    Hi All,

    I am using sudoers to enalble user to run a specific command.

    Cmnd_Alias MYCMNDS=/usr/sbin/useradd, /usr/sbin/userdel
    john ALL=MYCMNDS

    john ALL=(ALL) NOPASSWD: ALL


    every time I want to run the command as john I have to type sudo command. Is there a way to type the command only without sudo, just like root user.

    thanks

  2. #2
    Join Date
    Jan 2007
    Beans
    343
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: editing suduers

    You have to use sudo to run root commands.

    A workaround would be to use an alias. For example:

    Code:
    alias useradd='sudo /usr/sbin/useradd'
    Add this to your .bashrc file, and log out/in again. Then useradd will run without the sudo command. Do something similar for userdel.

  3. #3
    Join Date
    Mar 2009
    Beans
    14

    Re: editing suduers

    Quote Originally Posted by kpatz View Post
    You have to use sudo to run root commands.

    A workaround would be to use an alias. For example:

    Code:
    alias useradd='sudo /usr/sbin/useradd'
    Add this to your .bashrc file, and log out/in again. Then useradd will run without the sudo command. Do something similar for userdel.



    thank you, that is a good approach. this is my first time using this forum i don't know how to give you quot?

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: editing suduers

    If you wish to run commands without typing sudo, have you considered simple obraining a root shell ?

    Code:
    sudo -i
    At least that has been my approach when I wish to enter more then a single command as root.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Bookmarks

Posting Permissions

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