LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 04-04-2009, 09:19 PM   #1
Borax_Man
Member
 
Registered: Jan 2009
Posts: 31

Rep: Reputation: 16
Using PAM: Allowing access to 'poweroff' while logged out.


Hello all.

I have discovered that the poweroff command does not run if the user is logged out of the system (and is not root). However, as I use 'screen' to background batch jobs, or the atd daemon, and like to issue a 'poweroff' command at the end to shut down the system, I have a problem.

Because these are running in the background, and I am not logged in on any terminal, authentication fails. The file /etc/pam.d/poweroff is configured by default to check if the user is physically logged in at the terminal.

The user isn't. But I would still like authentication to succeed, that is allow the user (even if just my own account), to poweroff the system while not physically at the console.

This raises another issue, if i allow SSH access, than ANYONE can shutdown my system if I do this.

Is there anyway around this? Can I allow only my own user ID to shutdown the system while not logged in? How do I edit the PAM configuration file to do that? I've searched for ours and found all the documentation on PAM to be brief and incomplete.

My only other option is to put a chmod u+s copy of poweroff in my ~/bin directory and call this directory, but the PAM option is cleaner.

Thanks,
Borax Man
 
Old 04-15-2009, 09:04 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,644

Rep: Reputation: Disabled
Quote:
Originally Posted by Borax_Man View Post
...found all the documentation on PAM to be brief and incomplete...
Amen to that. Did you find a solution yet?
 
Old 04-16-2009, 04:32 AM   #3
Borax_Man
Member
 
Registered: Jan 2009
Posts: 31

Original Poster
Rep: Reputation: 16
Nope.

I've just made a copy of 'halt', renamed it as 'pd', put it on my ~/bin directory and made it suid root. Then I just have to specifically call that as 'pd -p', and it will poweroff, because its running as root.

Not ideal, but good enough.
 
Old 04-17-2009, 02:30 AM   #4
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,644

Rep: Reputation: Disabled
A workaround then. If you ever find a "true" solution let us know.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wu-ftpd is allowing access to / rbblue Linux - Networking 7 06-03-2008 03:18 PM
PAM -- Allowing only certain users access DennisC31 Linux - Security 1 01-05-2008 06:26 PM
Samba NOT allowing access cucolin@ Linux - Software 4 11-09-2006 03:34 PM
Allowing only SFTP access vanibhat Linux - Enterprise 8 06-30-2005 02:10 AM
family access to command poweroff & reboot pixelV Slackware 12 02-27-2003 03:18 PM


All times are GMT -5. The time now is 05:43 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration