Find the answer to your Linux question:
Results 1 to 3 of 3
Hello , i'll really appreciate help with this issue i have. I want to "poweroff" as normal user , then i modified the suders file with visudo like this : ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Location
    Mexico
    Posts
    29

    Question sudoers file problem.


    Hello , i'll really appreciate help with this issue i have. I want to "poweroff" as normal user , then i modified the suders file with visudo like this :

    Code:
    # Cmnd alias specification
    Cmnd_Alias TURNOFF= /sbin/poweroff,/sbin/shutdown
    
    # User privilege specification
    root           ALL=(ALL) ALL
    normal_user    ALL=(ALL) NOPASSWD: TURNOFF
    But then as normal user when i try to run "poweroff" with :

    Code:
    $ sudo poweroff
    It asks me fora Password it supposed that it won't ask me for a password with the NOPASSWD line isn't it ? Thank you

  2. #2
    Linux Engineer
    Join Date
    Nov 2004
    Location
    home
    Posts
    796
    Perhaps replacing normal_user with ALL will solve the problem. I don't see normal_user in the man page anywhere, I'm guessing (unless you have it defined as an alias) that sudo would let a user with the user name of normal_user run the command fine.

  3. #3
    Just Joined!
    Join Date
    Nov 2006
    Location
    Mexico
    Posts
    29

    Smile [solved] sudoers file problem

    Some mate suggested add the full path of poweroff like this :
    Code:
     $ sudo /sbin/poweroff
    and it worked . I came from Debian and i forget sometimes that things are done more "linux style" here in Slack. Thanks !

Posting Permissions

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