The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
LDAP - is there an API phykell High Level Programming 3 09-06-2008 05:03 AM
help with LDAP n00b SUN Solaris 5 06-24-2008 03:12 AM
LDAP help Katkota UNIX for Dummies Questions & Answers 0 12-06-2007 11:30 PM
ldap for aix pascalbout AIX 0 07-27-2006 05:56 AM
Ldap dipanrc Linux 2 12-28-2005 08:09 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-23-2009
JerryHone JerryHone is offline
Registered User
  
 

Join Date: Nov 2006
Location: UK
Posts: 178
NIS+ to LDAP

After months of threats, we're finally migrating servers from NIS+ to LDAP. I'm happy using niscat, nisgrep etc and now it seems I have to use ldapsearch which is far from being a simple CLI!
Are there any easy (easier?) ways to interrogate the LDAP directory?

Jerry
  #2 (permalink)  
Old 06-23-2009
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,917
Well you could use getent.

getent passwd <username> is like ypmatch <username> passwd
getent hosts <hostname> is like ypmatch <hostname> hosts
  #3 (permalink)  
Old 06-25-2009
JerryHone JerryHone is offline
Registered User
  
 

Join Date: Nov 2006
Location: UK
Posts: 178
I already use getent for passwd, group etc. but it doesn't work for other tables (scsu, scsudo etc)

Since my original post, I've come up with my own quick and dirty solution...

The following has been added to my profile
Code:
ldap() {
if [ -z $2 ] ; then
ldapsearch -h <host> -b ou=$1,dc=euruxdev,dc=dyn,dc=nsroot,dc=net objectclass='*'
else
ldapsearch -h <host> -b ou=$1,dc=euruxdev,dc=dyn,dc=nsroot,dc=net $2
fi
So if I type
ldap <table>
I get the whole lot, but I can add a filter with, for example
ldap <table> cn=<entry>

Jerry
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0