Project

General

Profile

Feature #688

auth via pam

Added by Anonymous almost 12 years ago. Updated 13 days ago.

Status:
Wontfix
Priority:
Normal
Assignee:
-
Category:
mod_auth
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Missing in 1.5.x:
No

Description

i miss to auth via pam.
it's very usefull, because one authentification system for all daemons.
i use pam for all services.

-- denis.knauf

lighttpd-02-pam_auth.patch (9.01 KB) lighttpd-02-pam_auth.patch sravas, 2014-08-07 23:52
0002-pam-auth.patch (9.65 KB) 0002-pam-auth.patch sravas, 2018-04-10 13:16

History

#1

Updated by Anonymous over 11 years ago

I would also like to see this option, i understand the concerns about running lighttpd as root but why not leave it as a option?

-- Shaun.Reitan <isat> NDCHost.com

#2

Updated by Anonymous about 11 years ago

You shouldn't need to have lighttpd run as root. You could just set the group of /etc/shadow to lighttpd and allow group read. If lighty supported it, I could move a few of my clients across.

-- richard

#3

Updated by Anonymous about 11 years ago

I would like to see PAM too... lighty's authentication options are a bit lacking at the moment. PAM would open the way to using MySQL, SQLite and every other PAM module out there. This is preventing me migrating an Apache instance over at the moment.

-- David Anderson

#4

Updated by Anonymous over 10 years ago

Count one more for PAM; it would be especially helpful when coordinating small development with Trac and Mercurial-over-SSH.

-- blinks

#5

Updated by darix over 10 years ago

  • Status changed from New to Fixed
  • Resolution set to wontfix

i removed all the pam code and i really dont feel like readding it. i would rather add support for httpauth or dovecot sasl. but not direct usage of pam.

ldap is no option for you?

#6

Updated by Anonymous over 10 years ago

The reason I'd like PAM is mainly just to work with the existing users on my system (that have SSH access). Will the other options allow this?

-- blinks

#7

Updated by darix over 10 years ago

Replying to :

The reason I'd like PAM is mainly just to work with the existing users on my system (that have SSH access). Will the other options allow this?

sure. i can understand that. but the price is too high imho.
even if you give lighttpd read permissions on the file and not run it as root. with a simple hole in a webapplication your shadow file could be retrieved and the whole server would be compromised.

the other options would allow pam auth yes.

#8

Updated by Anonymous over 10 years ago

Replying to darix:

the other options would allow pam auth yes.

That's just fine, then.

#9

Updated by Anonymous about 10 years ago

  • Status changed from Fixed to Need Feedback
  • Resolution deleted (wontfix)

Ok, Reasons for PAM:

  • PAM provides a flexible implementation of many methods to authenticate somebody/something.
  • PAM is NOT a securityhole. You are allowed to you something else then /etc/shadow. But you are allowed to use /etc/shadow, if you want.
  • PAM provides every authentication-method (1), which you can want to implement in lighttpd, but NOW.
  • Use PAM and you can remove some code. It provides everything, you need.

PAM allowes it, doesn't restrict it.

(1) TLS-Auth and something else isn't possible.

-- denis.knauf

#10

Updated by darix about 10 years ago

  • Status changed from Need Feedback to Fixed
  • Resolution set to wontfix

many people will want to use shadow based auth. that requires root permissions. we dont have an authentication helper that runs as root.

to not create false assumptions or get user running their webserver as root, we dropped the feature.

#11

Updated by stbuehler over 9 years ago

  • Status changed from Fixed to Wontfix
#12

Updated by pprkut over 6 years ago

Newer versions of PAM do no longer require pam_unix.so to be run as root, which I guess was the main argument against this feature in lighttpd. Maybe someone could look at it again?

#13

Updated by stbuehler over 6 years ago

  • Description updated (diff)
  • Missing in 1.5.x set to No

How would pam_unix.so work if it can't read /etc/shadow?

#14

Updated by pprkut over 6 years ago

I'm not a PAM expert, but I saw that MariaDB (MySQL fork) recently added a PAM authentication plugin. IMHO a database server has similar constraints about not running as root as a webserver.

In their wiki-page ( http://kb.askmonty.org/en/pam-authentication-plugin ) they have the following note:

if you configure PAM to use pam_unix.so and notice that MariaDB needs to run as a root user to be able to access /etc/shadow — try to upgrade your PAM installation. Newer versions of PAM do not require pam_unix.so to be run as root.

#15

Updated by stbuehler over 6 years ago

You would either need a daemon running as root providing access (but then it wouldn't be pam_unix anymore), or you need a suid binary. There is only a suid binary for checking the password for your own user (for things like locking the screen).

Providing a simple way of checking passwords for local users would be STUPID (preventing that is the point of shadow after all).

#16

Updated by sravas almost 4 years ago

If there is anybody interested, here is my patch against 1.4.35 implementing simple PAM authentification.

#17

Updated by sravas about 2 months ago

The same patch updated for 1.4.45.

#18

Updated by yurylankovskiy 13 days ago

sravas wrote:

The same patch updated for 1.4.45.

Hello sravas, can you please share some information with me on how you've integrated the patch. I'm running 1.4.48 version of lighttpd, but it should not matter.

1. How did you compile --with-pam? Any dependencies included?
2. After compilation, you've moved mod_authn_pam.so to libraries folder and included "mod_authn_pam" in the lighttpd config?

The issue I'm having, is I'm able to compile with just the --with-pam flag, after I can see that lighttpd has pam included in the list of modules. Lighttpd restarts successfully, however, I get out of memory issues if I include the "mod_authn_pam".

I would highly appreciate, if you share some of your knowledge.

Also, would be nice to see a sample of your pam configuration from lighttpd.config

Thanks!

Also available in: Atom