View previous topic :: View next topic |
Author |
Message |
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Fri Aug 27, 2004 3:10 am Post subject: Can't poweroff, nor shutdown |
|
|
Sorry im nob
I can't poweroff or shutdown the system, not enough rights.
In sudoers file I wrote ALL=ALL NOPASSWORD:/sbin/shutdown, or something. Added me to the wheel group, let %wheel do ALL. No change.
Seems it's simple to configure but i just dont know how |
|
Back to top |
|
|
scoon l33t
Joined: 23 Aug 2003 Posts: 747 Location: Philadelphia, PA
|
Posted: Fri Aug 27, 2004 6:03 am Post subject: Re: Can't poweroff, nor shutdown |
|
|
amalghama wrote: | Sorry im nob
I can't poweroff or shutdown the system, not enough rights.
In sudoers file I wrote ALL=ALL NOPASSWORD:/sbin/shutdown, or something. Added me to the wheel group, let %wheel do ALL. No change.
Seems it's simple to configure but i just dont know how |
Hey there,
What errors are there that you can find ?
scoon _________________ Hope this helps........ |
|
Back to top |
|
|
mbjr Guru
Joined: 17 Jan 2004 Posts: 531 Location: Budapest/Hungary
|
Posted: Fri Aug 27, 2004 6:24 am Post subject: |
|
|
Hi,
I assume you're trying to shutdown as a regular user and not as root. Is it working fine with root?
From my /etc/sudoers:
Code: | # User privilege specification
root ALL=(ALL) ALL
# 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 |
I assume you'll need:
Code: | %wheel ALL=(ALL) NOPASSWD: ALL |
to be set
This lets you run ALL with NOPASSWD as in %wheel, also if you want to give %wheel users just the shutdown possibility, you'll need:
Code: | %wheel localhost=/sbin/shutdown -h now |
Don't set all users to be able to shutdown. If you want all users (regular users), use your %users group to do it, and add every regular user to thatone. _________________ mb |
|
Back to top |
|
|
gnuageux Veteran
Joined: 17 Apr 2004 Posts: 1201
|
Posted: Fri Aug 27, 2004 6:56 am Post subject: |
|
|
Quote: | In sudoers file I wrote ALL=ALL NOPASSWORD:/sbin/shutdown, or something. |
Danger will Robinson, DANGER!
Maybe you could post that portion of sudoers so we can take a look? _________________ The realOTW: http://forums.realotw.org/index.php
Registered Linux user#364538 |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20580
|
Posted: Fri Aug 27, 2004 2:55 pm Post subject: |
|
|
Moved from Installing Gentoo. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Sat Aug 28, 2004 10:15 pm Post subject: |
|
|
Well that's my /etc/sudoers file, what I do wrong??
Code: | # 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
# Cmnd alias specification
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
# 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 /mnt/cdrom,/sbin/umount /mnt/cdrom
%users ALL=/sbin/shutdown -h now
%users ALL=/sbin/reboot
%users ALL=/sbin/poweroff |
And here's my id:
Code: | uid=1000(amalghama) gid=35(games) groups=10(wheel),27(video),35(games),100(users),250(portage),440(amalghama) |
This just kills me |
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Sun Aug 29, 2004 3:55 am Post subject: |
|
|
Either I'm drunk or my sudoers file MUST work that way. But it doesn't. I can sudo as it defined in /etc/sudoers, but I can't poweroff:
$poweroff: command not found
$/sbin/poweroff: you must have administrators permissions
ps of course i can poweroff as root... |
|
Back to top |
|
|
dalek Veteran
Joined: 19 Sep 2003 Posts: 1353 Location: Mississippi USA
|
Posted: Sun Aug 29, 2004 4:49 am Post subject: |
|
|
Well here is my file so you can compare, not that I see much difference though.
Code: | # 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
# Cmnd alias specification
# Defaults specification
# User privilege specification
root ALL=(ALL) ALL
# 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
|
Looks like the only line it sees is root ALL=(ALL)ALL.
Hope that helps. I can shutdown in KDE as dale but only root when in console.
Later
_________________ My rig: Gigabyte GA-970A-UD3P mobo, AMD FX-8350 Eight-Core CPU, ZALMAN CNPS10X Performa CPU cooler,
G.SKILL 32GB DDR3 PC3 12800 Memory Nvidia GTX-650 video card LG W2253 Monitor
60TBs of hard drive space using LVM
Cooler Master HAF-932 Case |
|
Back to top |
|
|
devon l33t
Joined: 23 Jun 2003 Posts: 943
|
Posted: Sun Aug 29, 2004 6:13 am Post subject: |
|
|
amalghama wrote: | I can sudo as it defined in /etc/sudoers, but I can't poweroff:
$poweroff: command not found
$/sbin/poweroff: you must have administrators permissions |
Don't you need to type "sudo" in front of the command?
Code: | $ sudo /sbin/poweroff |
|
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Sun Aug 29, 2004 1:38 pm Post subject: |
|
|
devon wrote: | Don't you need to type "sudo" in front of the command?
Code: | $ sudo /sbin/poweroff |
|
That's right, but is this good? e.g. in redhat i can only type as a user that way: poweroff, and alas! So how can i do it in Gentoo???
Thanks!
ps btw permissions on /sbin/halt are ok, 755, if its important with the problem... |
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Sun Aug 29, 2004 9:37 pm Post subject: |
|
|
No, my /etc/sudoers seems correct.
But a user cant reboot anyway without sudoing.
But there MUST be a way out!
Which?... |
|
Back to top |
|
|
devon l33t
Joined: 23 Jun 2003 Posts: 943
|
Posted: Sun Aug 29, 2004 10:02 pm Post subject: |
|
|
What does "ls -l /sbin/halt" show in the RedHat box? This is from a RedHat 8 box at work:
Code: | $ ls -l /sbin/halt
-rwxr-xr-x 1 root root 12645 Jul 18 2002 /sbin/halt
$ cat /etc/redhat-release
Red Hat Linux release 8.0 (Psyche) |
|
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Mon Aug 30, 2004 11:03 pm Post subject: |
|
|
devon wrote: | What does "ls -l /sbin/halt" show in the RedHat box? This is from a RedHat 8 box at work:
Code: | $ ls -l /sbin/halt
-rwxr-xr-x 1 root root 12645 Jul 18 2002 /sbin/halt
$ cat /etc/redhat-release
Red Hat Linux release 8.0 (Psyche) |
|
thats it:
ls -l /sbin/halt
$ ls -l /sbin/halt
-rwxr-xr-x 1 root root
...And?... |
|
Back to top |
|
|
davidblewett Apprentice
Joined: 15 Feb 2004 Posts: 274 Location: Indiana
|
Posted: Tue Aug 31, 2004 12:57 pm Post subject: |
|
|
If Code: | $sudo /sbin/poweroff | works, and you just want to use All you'll need to do is add an alias in your .bashrc file. I.e.: Code: | alias poweroff='sudo /sbin/poweroff' | In order to use it immediately, you'll need to _________________ No guilt in life, no fear in death
this is the power of Christ in me
From lifes first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album" |
|
Back to top |
|
|
amalghama n00b
Joined: 22 Jul 2004 Posts: 32
|
Posted: Sun Sep 05, 2004 10:18 am Post subject: SOLVED |
|
|
Thanks, all works fine now! |
|
Back to top |
|
|
|