Results 1 to 5 of 5

Thread: linux question

  1. #1
    Lost in the ethernet dragonrider2004 may be famous one day dragonrider2004 may be famous one day dragonrider2004's Avatar
    Join Date
    Oct 2004
    Location
    127.0.0.1
    Posts
    729
    Thanks
    0
    Thanked 0 Times in 0 Posts

    linux question

    how can i set it up so my linux box allows users other than root shut down the machine? it lets anyone reboot the m,achine but it only allows root to shut the machine down, even though all users can run the shutdown call?

    help? please?

    Student: "Umm sensei, the question on the board is wrong."
    Teacher "SHAAAADD UP!"

  2. #2
    Newbie JEEB may be famous one day JEEB may be famous one day JEEB's Avatar
    Join Date
    Feb 2005
    Location
    フィンランド
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts
    SUDO (superuser do) should do the trick, if you're not using any mainstream Desktop manager like KDE or Gnome (which would have the option in its 'start-like' menu). Just configure sudo to let some users/a user group to execute a command or series of commands. Then the box will ask his/hers password, not root's. Or no password at all.

    Some more reading on SUDO (the linked archive page has many links to various pages about SUDO or SUDO configuration) [NetBSD Archives (a Linux question)]
    Last edited by JEEB; May 11, 2005 at 12:43 AM.
    人生フゥ~!!!

  3. #3
    あなた& Ectoruss may be famous one day Ectoruss may be famous one day Ectoruss's Avatar
    Join Date
    Nov 2004
    Location
    Qu├ębec, Canada, North America, Earth, Solar system, ... ! >_<
    Posts
    622
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Same as JEEB. Don't really have other idea.

    Why am I always late for those questionning!!!!!
    Coming soon.........

  4. #4
    Lost in the ethernet dragonrider2004 may be famous one day dragonrider2004 may be famous one day dragonrider2004's Avatar
    Join Date
    Oct 2004
    Location
    127.0.0.1
    Posts
    729
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i tried that. but sudo keeps saying it can't find the shutdown command.

    users supposed to be authorized: libbyp, dragonrider
    hostname: DarkStar1 (variation on default, no network name for slackware)
    Quote Originally Posted by /etc/sudoers
    # sudoers file.
    #
    # This file MUST be edited with the 'visudo' command as root.
    #
    # See the sudoers man page for the details on how to write a sudoers file.
    #

    # Host alias specification

    # User alias specification
    User_Alias PEOPLE = libbyp, dragonrider

    # Cmnd alias specification
    Cmnd_Alias SHUTDOWN = /sbin/shutdown, /sbin/halt, /sbin/reboot

    # Defaults specification

    # Runas alias specification

    # User privilege specification
    root ALL=(ALL) ALL
    PEOPLE DarkStar1 = PASSWD: SHUTDOWN

    # Uncomment to allow people in group wheel to run all commands
    # %wheel ALL=(ALL) ALL

    # Same thing without a password
    # %wheel ALL=(ALL) NOPASSWD: ALL

    # Samples
    # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
    # %users localhost=/sbin/shutdown -h now
    now what am i doing wrong? i tried the man pages for sudo and got nothing. i'm more confused than i was before.

    Student: "Umm sensei, the question on the board is wrong."
    Teacher "SHAAAADD UP!"

  5. #5
    Newbie JEEB may be famous one day JEEB may be famous one day JEEB's Avatar
    Join Date
    Feb 2005
    Location
    フィンランド
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Read a bit of the SUDO Sudoers manual and saw that the path used for shutdown is:
    Quote Originally Posted by Sudoers Manual
    ...
    Cmnd_Alias PRINTING = /usr/sbin/lpc, /usr/bin/lprm
    Cmnd_Alias SHUTDOWN = /usr/sbin/shutdown
    Cmnd_Alias HALT = /usr/sbin/halt
    Cmnd_Alias REBOOT = /usr/sbin/reboot
    ...
    /usr/sbin/shutdown as yours is just /sbin/shutdown. Don't know if that actually affects anything, though, since you could've moved the scripts yourself for added privacy/security (which would've needed a lot of custom scripting).

    After that I see nothing weird. Could be that the structure is wrong or something (spaces instead of tabs somewhere). Try reading the sudoers manual further and see what happens if you (for example) remove the 'PASSWD:' part or something. Right now I have no other idea, but on a side note - I'm not a "professional" Linux user.
    人生フゥ~!!!

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