LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-22-2011, 07:05 AM   #1
Mareq
LQ Newbie
 
Registered: Oct 2011
Distribution: Debian
Posts: 1

Rep: Reputation: Disabled
PAM/NSS: Local & Global users synchronization problem


Hi,
I am setting up global database for PAM/NSS. Everything is pretty clear (at least I think), except one thing I do not seem to understand. Imagine scenario with two machines using shared database for PAM/NSS purposes and this course of actions:
1. Administrator adds new local user, named, say 'problematic', using adduser command on machine #1. This will create appropriate records in first machine's /etc/passwd and /etc/shadow files. So far so good, we have new local user, who can log in only on the machine #1.
2. Administrator adds new global user with the very same name 'problematic' into global database, shared by both machines. Moreover, he does that from machine #2, so there is no way how to check existence of local user created in the first step (other than checking /etc/passwd file from all machines, which can become little tedious in similar scenario with tens or even hundreds of machines, thus this is not viable solution).

After step 2., we end up with two conflicting users, with completely different passwords - the first local on machine #1 and the second global for all other machines. Depending on /etc/nsswitch.conf, on machine #1, either global user will be shadowed by the local one ('file, shared_database' setting) or vice versa, i.e. local user will be suddenly replaced by the global one ('shared_database, file' setting).

The only solution which I can think of is to add information about existence of all local users from all machines to shared database and check this information prior to adding any global user, refusing to create global user with the same name as already existing local one. However, in order to update such information in global database, 'adduser' command (and all of its friends) needs to be hacked to do so.

This of course includes relatively lot of manual hacking and since it seems to me that it is rather very common problem, I am posting it here in hope I will find someone, who already solved it and who can point me to probably existing, and possibly even well known, solution.

Thanks for help!

.mq.



PS: Just to be complete, I intentionally did not specify 'shared_database', because I think that this problem is applicable to any NSS library, one may use. But since the solution may differ, depending on the used library, I am including this information here. In my particular case, I am planning to use libpam-pgsql/libnss-pgsql (or possibly, but less probably libpam-ldap/libnss-ldap with PostgreSQL backend, but I think it is unnecessarily more work), because I need this database to provide user information also to some other applications, which require it in MySQL/PostgreSQL database.
 
  


Reply



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
Centos 6, Samba 3.5.4 and nss-pam-ldapd cobly Linux - Software 1 08-20-2011 09:11 AM
[SOLVED] How to enable BOTH virtual & local vsftpd logins with PAM? quasidynamic Linux - Software 3 08-12-2010 12:00 PM
OpenLDAP SSL/TLS problem with pam/nss humbletech99 Linux - Server 0 06-12-2009 07:39 AM
Pam Mysql Nss server-solution Linux - Software 1 02-24-2006 10:39 AM
Trying to understand Relationship of NSS and PAM saneax Linux - General 0 09-16-2005 04:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration