Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.