Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: [SOLVED] shutdown without password

  1. #11
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: shutdown without password

    Sorry, forgot a change I had made to make it work. Make shutdown executable by your user. Something like:
    Code:
    sudo chmod 777 /sbin/shutdown
    And there is no reason to restart, worked for me just after I made the changes. I also recomend you use
    Code:
     sudo shutdown -h 10
    or something so it doesn't shutdown on you just as you are trying it out

  2. #12
    Join Date
    Mar 2009
    Location
    Land of the sand
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: shutdown without password

    Quote Originally Posted by televisi View Post
    Hi Purple,
    I put exactly the same as you suggested then I:
    - restart manually the system
    - login back as user
    - run sudo shutdown -r now
    - System still asking me for the SUDO password, strange things?

    is it really a big matter to put <SPACE> or <TAB> in combination in between characters?

    Code:
    user<SPACE>ALL<SPACE>=<SPACE>(ALL)<SPACE>NOPASSWD:<SPACE>/sbin/shutdown
    or
    Code:
    user<TAB>ALL<SPACE>=<SPACE>(ALL)<SPACE>NOPASSWD:<SPACE>/sbin/shutdown
    Hi televisi,
    As aysiu has already mentioned, please use your own username instead of user and save the sudoers file. Putting space in between is not necessary. It works fine for me and /etc/init.d is not needed. Did you place the line at the end of sudoers file? Because if you place it above, it will get overwritten. You do not need to change permission of any file either.
    Last edited by _Purple_; June 8th, 2009 at 06:36 AM.
    Peace
    YAY! #200

  3. #13
    Join Date
    Feb 2007
    Location
    Marseille, France
    Beans
    184
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: shutdown without password

    _Purple_ : It works for you without the /etc/init.d line? Really? That's weird, I had to add it or it still asked for the password. Strange...

  4. #14
    Join Date
    Mar 2009
    Location
    Land of the sand
    Beans
    Hidden!
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: shutdown without password

    Quote Originally Posted by terdon View Post
    _Purple_ : It works for you without the /etc/init.d line? Really? That's weird, I had to add it or it still asked for the password. Strange...
    terdon,
    Yes, it works. I have checked in both Intrepid and Jaunty.
    Peace
    YAY! #200

  5. #15
    Join Date
    Apr 2009
    Beans
    80
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: shutdown without password

    Yay!!! THANKS!!!
    This is the end result:
    - Assumed user = televisi
    - sudo visudo
    Code:
    # /etc/sudoers
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the man page for details on how to write a sudoers file.
    #
    
    Defaults        env_reset
    
    # Host alias specification
    
    # User alias specification
    
    # Cmnd alias specification
    
    # User privilege specification
    root    ALL=(ALL) ALL
    #%televisi ALL=(ALL) NOPASSWD:/usr/bin/rsync, /sbin/shutdown
    
    # Uncomment to allow members of group sudo to not need a password
    # (Note that later entries override this, so you might need to move
    # it further down)
    # %sudo ALL=NOPASSWD: ALL
    
    # Members of the admin group may gain root privileges
    %admin ALL=(ALL) ALL
    televisi ALL=(ALL) NOPASSWD:/usr/bin/rsync, /sbin/shutdown
    Originally I put the televisi ALL=(ALL) NOPASSWD:/usr/bin/rsync, /sbin/shutdown line above %admin ALL=(ALL) ALL

    Apparently this shouldn't be done (as per _Purple_ suggestion).

    As this is working for me now, I'll continue my work to use rsync backup using sudo to preserve the file permission as per http://notepad.bobkmertz.com/2008/04...ssion-via.html

    THANKS!!!

Page 2 of 2 FirstFirst 12

Tags for this Thread

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
  •