Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't poweroff, nor shutdown
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Fri Aug 27, 2004 3:10 am    Post subject: Can't poweroff, nor shutdown Reply with quote

Sorry im nob :D
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 :oops: :roll:
Back to top
View user's profile Send private message
scoon
l33t
l33t


Joined: 23 Aug 2003
Posts: 747
Location: Philadelphia, PA

PostPosted: Fri Aug 27, 2004 6:03 am    Post subject: Re: Can't poweroff, nor shutdown Reply with quote

amalghama wrote:
Sorry im nob :D
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 :oops: :roll:


Hey there,

What errors are there that you can find ?

scoon
_________________
Hope this helps........
Back to top
View user's profile Send private message
mbjr
Guru
Guru


Joined: 17 Jan 2004
Posts: 531
Location: Budapest/Hungary

PostPosted: Fri Aug 27, 2004 6:24 am    Post subject: Reply with quote

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
View user's profile Send private message
gnuageux
Veteran
Veteran


Joined: 17 Apr 2004
Posts: 1201

PostPosted: Fri Aug 27, 2004 6:56 am    Post subject: Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20580

PostPosted: Fri Aug 27, 2004 2:55 pm    Post subject: Reply with quote

Moved from Installing Gentoo.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Sat Aug 28, 2004 10:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Sun Aug 29, 2004 3:55 am    Post subject: Reply with quote

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
:?: :?: :?: :cry: :cry:

ps of course i can poweroff as root...
Back to top
View user's profile Send private message
dalek
Veteran
Veteran


Joined: 19 Sep 2003
Posts: 1353
Location: Mississippi USA

PostPosted: Sun Aug 29, 2004 4:49 am    Post subject: Reply with quote

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

:D :D :D :D
_________________
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
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Sun Aug 29, 2004 6:13 am    Post subject: Reply with quote

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
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Sun Aug 29, 2004 1:38 pm    Post subject: Reply with quote

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? :wink: 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
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Sun Aug 29, 2004 9:37 pm    Post subject: Reply with quote

No, my /etc/sudoers seems correct.
But a user cant reboot anyway without sudoing.
But there MUST be a way out!
Which?... :roll: :roll: :roll:
Back to top
View user's profile Send private message
devon
l33t
l33t


Joined: 23 Jun 2003
Posts: 943

PostPosted: Sun Aug 29, 2004 10:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Mon Aug 30, 2004 11:03 pm    Post subject: Reply with quote

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?... :roll:
Back to top
View user's profile Send private message
davidblewett
Apprentice
Apprentice


Joined: 15 Feb 2004
Posts: 274
Location: Indiana

PostPosted: Tue Aug 31, 2004 12:57 pm    Post subject: Reply with quote

If
Code:
$sudo /sbin/poweroff
works, and you just want to use
Code:
$poweroff
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
Code:
$source ~/.bashrc

_________________
No guilt in life, no fear in death
this is the power of Christ in me
From life’s first cry to final breath
Jesus commands my destiny
-- Newsboys, "In Christ Alone", "Adoration: The Worship Album"
Back to top
View user's profile Send private message
amalghama
n00b
n00b


Joined: 22 Jul 2004
Posts: 32

PostPosted: Sun Sep 05, 2004 10:18 am    Post subject: SOLVED Reply with quote

Thanks, all works fine now!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum