LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-04-2011, 11:37 PM   #1
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Rep: Reputation: 1
LDAP 'description' attribute access.


Hi Friends,
Please let me know how can i access 'description' attribute stored in LDAP server from LDAP client(pam_ldap,nss_ldap).

Thank you.

Regards,
Vijay S.
 
Old 09-05-2011, 06:05 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
'man ldapsearch' ?
 
Old 09-05-2011, 08:24 PM   #3
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Original Poster
Rep: Reputation: 1
no, I am running LDAP clients (pam_ldap.so and nss_ldap.so) on one linux machine and openLDAP server on the other machine. I have created few users and groups, for these entries i have created description also. I don't know how to access this 'description' attribute from client machine.

I tried using "getent passwd" "getent group", but description field is not displayed.

Please let me know how to access this attribute.

Thanks and Regards,
Vijay S.
 
Old 09-05-2011, 10:27 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
In that case you probably want to map the attributes correctly, try adding:

Code:
nss_map_attribute gecos description
.. in /etc/ldap.conf
 
Old 09-06-2011, 12:23 AM   #5
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Original Poster
Rep: Reputation: 1
I tried this, but didn't get the required information.

Let me explain what i need clearly. when i issue "getent passwd" or "getent group" commands I'll get the user information like name,uid,gid. getent will internally use getpwnam() or getgrnam() functions to fetch the information from LDAP server running on the other machine.

Similarly I want to fetch "description" attribute from a perticular user entry, example entry is shown below.

dn: cn=Vijay Sheelavantar, ou=people, dc=samsung, dc=com
cn: Vijay S Sheelavantar
sn: Sheelavantar
objectclass: top
objectclass: person
objectclass: posixAccount
objectclass: shadowAccount
uid:vijay
userpassword:123qwe
uidnumber:104
gidnumber:100
loginShell:/bin/bash
homeDirectory: /home/vijay
description: This is user vijay's account

I want to access this description attribute from LDAP server at client side.
 
Old 09-06-2011, 06:07 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Performing the mapping will put the value of the description attribute into the gecos field for ldap users when running 'getent passwd'

eg.
Code:
getent passwd kbp | cut -d: -f5
I think we're not quite on the same page ... if you want to query a remote ldap server then you'll need to use a tool that can talk ldap like ldapsearch. If the machine you're on is using the ldap server for authentication/naming then you can use 'getent passwd'.
 
Old 09-06-2011, 09:00 PM   #7
sheelavantar
Member
 
Registered: Aug 2010
Posts: 69

Original Poster
Rep: Reputation: 1
Thank you very much...

It solved my problem, now I can access the description field.

Thank you.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
PhP & Ldap : Undefined attribute type jonaskellens Linux - Newbie 3 03-24-2011 04:28 AM
How do I modify 1 of my ldap attribute if I have 2 same attribute under 1 entry? chinho Programming 1 01-31-2011 03:37 AM
samba4: LDAP memberOf: attribute type undefined touzeaud Linux - Server 10 04-13-2009 07:03 PM
LDAP attribute aravind1024004 Linux - Server 1 04-12-2008 01:29 PM
how to define manager or reporting to attribute in qmail-ldap Sanvi Bansal Linux - Server 1 02-09-2007 02:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:31 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