canweriotnow / rpam-ruby19

PAM auth for Ruby - 1.9 compat version
https://rubygems.org/gems/rpam-ruby19
GNU General Public License v2.0
9 stars 5 forks source link

trouble authenticating other user than <me> #2

Closed sajimon closed 12 years ago

sajimon commented 12 years ago

Hello, I've installed rpam-ruby19, copied login file in my /etc/pam.d dir and when i'm running example script from Your repo, I can only authenticate as myself. Also checked on another account, gave me same result.

Im pretty sure its PAM configuration issue, but i couldnt find any soultion. Any seggestions?

canweriotnow commented 12 years ago

Hmmm... I haven't seen anything like this before... can you post your OS/version and the contents of /etc/pam.d/login ? I'll see if I can narrow down the issue.

sajimon commented 12 years ago

I'm using Gentoo as my dev distribution, it's a rolling release so can't give You exact version.

Here is my pam.d/login contents

auth required pam_securetty.so auth include system-local-login

account include system-local-login password include system-local-login session include system-local-login

i'll repeat, to be clear, only user running the script can be successfully authenticated.

canweriotnow commented 12 years ago

@sajimon, thanks. All of my linux machines are at work right now, so I probably won't really get to go into this until monday, but I'll definitely look into it. It may have to with the PAM config, which, if nothing else, is good to know.

I'll get in touch as soon as I have a chance to try to reproduce this.

Thanks again,

Jason

sajimon commented 12 years ago

Ah there is another thing i discovered. When I run Your example script as root, I can authenticate as any user in the system,.

fredemmott commented 12 years ago

This is expected behaviour on systems using shadow passwords (unless /sbin/unix_chkpwd is suid); confirming the password requires reading /etc/shadow, which should not be readable by any user other than root.

sajimon commented 12 years ago

Yea, I think that's it. It's a good piece of information to be appended to gem documentation. Thanks for involvement fredemmott & canweriotnow.

canweriotnow commented 12 years ago

Updated README.rdoc to reflect this. Thanks @sajimon and @fredemmott for reporting/diagnosing this issue.

Closing, feel free to send pull requests with changes to docs if you think it could be clearer.