LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 11-09-2005, 10:11 PM   #1
Visko
LQ Newbie
 
Registered: Mar 2004
Posts: 18

Rep: Reputation: 0
/etc/pam.d files permissions


Redhat's default permissions for pam security directive files in /etc/pam.d have permissions set root: all group: read world: read. In the interest of security I'd really prefer that the files aren't even readable, so when I start tinkering with required directives unauthorized users won't even be able to check my changes.

How restrictive can I make the permissions on these files and still have PAM able to use them? Does PAM run as a system-level process and/or root level at all times so it can read files only authorized for root-level access of any sort?

-Visko
 
Old 11-10-2005, 04:33 AM   #2
Neverendingo
Member
 
Registered: Dec 2004
Location: Dortmund, Germany
Distribution: Kubuntu 6.10 Edgy Eft
Posts: 33

Rep: Reputation: 15
Hello!

i tried it on my SuSE-System, removed the permissions except root and it worked.
But you should test it with root logged in, to change it back if it doesn't work for you.
 
Old 11-10-2005, 08:17 PM   #3
Visko
LQ Newbie
 
Registered: Mar 2004
Posts: 18

Original Poster
Rep: Reputation: 0
I've made the changes myself; I'll be using the system daily and extensively from here on out, and I'll post any problems if/as they arise. However, if this DOES work, I don't see why it shouldn't be the default option for these config files. Letting unauthorized people look at what security is being implemented for various commands just seems like another opportunity for exploitation.

-Visko
 
Old 11-11-2005, 02:10 AM   #4
Neverendingo
Member
 
Registered: Dec 2004
Location: Dortmund, Germany
Distribution: Kubuntu 6.10 Edgy Eft
Posts: 33

Rep: Reputation: 15
What the RFC says:
"Security of the configuration file:
Since the policy file dictates how the user is authenticated,
this file should be protected from unauthorized modifications."
That's all.
Maybe you're right. But only if you can read the configs, you can't know how to compromise the system, i think.
PAM doesn't let the application know, which module has failed during authentication, so you can't see where's the vulnerability. Also, PAM doesn't ask for the password a second time, if it fails.
That's only my thought, but you could be right and nobody should be able to read the config except root.

Greetings,
Ingo
 
Old 11-11-2005, 01:57 PM   #5
Visko
LQ Newbie
 
Registered: Mar 2004
Posts: 18

Original Poster
Rep: Reputation: 0
That's the idea; PAM is good about hiding which modules and metrics you are using for authentication, but if its config files are world-readable (as they are in a default Fedora Core 4 installation) than the obscurity of which pam modules are being used is...not very obscured.

Merits or faults of obscurity aside, this could be one more added layer of protection when using PAM.

-Visko
 
Old 11-11-2005, 02:25 PM   #6
Neverendingo
Member
 
Registered: Dec 2004
Location: Dortmund, Germany
Distribution: Kubuntu 6.10 Edgy Eft
Posts: 33

Rep: Reputation: 15
Yes, you're right.
BTW, the same in Debian and SuSE, all configs are readable per default.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you change a files permissions Charlie Chan Linux - Security 8 10-20-2004 10:19 PM
vsftpd + pam + virtual users - Pam cannot load database file. mdkelly069 Linux - Networking 3 09-22-2004 11:07 PM
Including files and permissions kidestranged Linux - General 2 07-27-2004 07:31 PM
Setting permissions to files. lonny Linux - Newbie 1 12-08-2003 07:09 PM
How to modify PAM.d conf. files sunnycn Linux - General 0 05-20-2002 10:47 AM


All times are GMT -5. The time now is 05:31 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
Open Source Consulting | Domain Registration