LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-26-2010, 06:47 AM   #1
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Rep: Reputation: 36
Question OpenLDAP bespoke schema to use 'ismemberof' to restrict user access to hosts


Hi,

I wanted to restrict users to logging onto specific hosts, I.e. to keep developers away from Production hosts etc. I managed to do this on thread http://www.linuxquestions.org/questi...-users-789466/ using Sun's SDSCC.

We're now migrating to OpenLDAP and I need the same functionality. I found the 'ismemberof' attribute does not appear to be part of the default schemas that come with Redhat 5.3 RPM's, Openldap is V 2.3.43.

I found an interesting article at http://forums.devshed.com/ldap-progr...te-191444.html on how to create your own schema's. So I created a file called /etc/openldap/schema/memberof.schema and put in the following text:

# The isMemberOf attribute associated with an entity is a
# collection of values each of which identifies a group to
# which that entity belongs.
attributetype ( 1.3.6.1.4.1.5923.1.5.1.1
NAME 'isMemberOf'
DESC 'identifiers for groups to which containing entity belongs'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX '1.3.6.1.4.1.1466.115.121.1.15' )

Then I added this schema to the slapd.conf and restarted ldap.

In the client, I've used the same 'ismemberof' line from my previous thread, so it says:

nss_base_passwd ou=people,dc=ldn,dc=sw,dc=com?sub?isMemberOf=cn=access,ou=auth,dc=ldn,dc=sw,dc=com

Having tried MANY combination's of ?, ( and ) it won't work.

So, can anyone comment on my schema, it right? is it complete sh!te?
Does the nss_apsswd line need changing now I've moved to Openldap?

Comments on a postcard please.

BTW - I've been looking at LDAP books to cure my insomnia, and found http://www.amazon.co.uk/LDAP-Directo...2282151&sr=1-1. The books.google.com site had some useful pages from this book but the review on amazon is not great.

TIA

Stuart.
 
Old 04-27-2010, 03:00 AM   #2
rizhun
Member
 
Registered: Jun 2005
Location: England
Distribution: Ubuntu, SLES, AIX
Posts: 268

Rep: Reputation: 47
Hi Stuart,

I couldn't comment on your schema, I've never set this up. I can offer you an alternative way of achieving the same goal though; I've set something up on our servers to restrict access using OpenLDAP.

I created several NIS groups inside our OpenLDAP directory and assigned users to them.
You can then specify the NIS groups that are allowed to login in /etc/passwd by adding something like the following to the end of the file:

Code:
+@nisgroupname::::::
+@anothernisgroup::::::
Once this is configured, you have 2 ways to modify access:
  • Create a new NIS group and add it to /etc/passwd.
  • Modify the members of an existing NIS group.

You can also grant access in the sudoers file based on NIS groups, so this is a very configurable way to restrict access to certain groups of people.

In my environment, I have created a 'dayaccess' NIS group. I can add LDAP users to the group using a script, and a cron job runs another script that empties the NIS group at midnight. This enables me to quickly grant temporary, limited access to users, without having to remember to remove them later.

This obviously isn't the way you were intending to do this, but it's another way of doing the same thing and therefore worth bringing to your attention.

Good luck.
 
Old 04-27-2010, 04:12 AM   #3
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Original Poster
Rep: Reputation: 36
Riz,

Thanks for the input, this was to be my second option if I couldn't get the Openldap profiling to work correctly. Hopefully someone will be able to point out where I've gone wrong.

Thanks,

Stuart.
 
Old 05-04-2010, 02:42 AM   #4
stuart_cherrington
Member
 
Registered: Aug 2008
Location: Get back in your Cube Unix Boy!
Distribution: rh5, oel5, debian etch, solaris
Posts: 228

Original Poster
Rep: Reputation: 36
Don't suppose anyone else has any ideas? Dave/ilikejam was able to help me last time.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add a new schema to openldap 2.4.11 ? cviniciusm Linux - Server 17 10-22-2016 02:26 AM
active directory schema for OpenLDAP paul_mat Linux - Networking 4 08-04-2008 05:00 AM
can't restrict sshd access through hosts.allow and hosts.deny but was working earlier farhan Linux - Security 4 04-18-2008 07:41 AM
OpenLDAP schema for mail (postfix/sendmail/...) nielchiano Linux - Software 0 02-15-2004 09:54 AM
How to restrict only one user can use telnet in /etc/hosts.deny? lzyking Linux - Software 2 02-12-2003 07:19 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:49 PM.

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