Sponsored Content
Operating Systems Linux SuSE Fetch port services from LDAP server Post 302989133 by Sridaran on Monday 9th of January 2017 03:06:30 AM
Old 01-09-2017
Fetch port services from LDAP server

Hi,

We have a ldap server configured with services (port) and want to know how to fetch that to the ldap clients:


Code:
# cat /etc/nsswitch.conf|grep -i services
services: files sss (neither sss nor ldap works)

by doing "#getent services" I am getting only the result from /etc/services but I need to fetch all the services entry from LDAP server.

LDAP server:
Code:
Objectclass top
Objectclass Organizationunit
ou Services

Do we have to add anything on sssd.conf or ldap.conf to fetch services entry from LDAP?


Code:
# ldapsearch -x -b "ou=Services,dc=xxx,dc=xxx" "ipServicePort=10000"
# extended LDIF
#
# LDAPv3
# base <ou=Services,dc=xxx,dc=xxx> with scope subtree
# filter: ipServicePort=10000
# requesting: ALL
#

# portapp + tcp, Services, xxx.xxx
dn: cn=portapp+ipServiceProtocol=tcp,ou=Services,dc=xxx,dc=xxx
objectClass: top
objectClass: ipService
cn: portMMI
ipServiceProtocol: tcp
ipServicePort: 10000

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

Thanks in advance!

Regards,
Sridaran


Moderator's Comments:
Mod Comment Use code tags, thanks.

Last edited by zaxxon; 01-09-2017 at 04:44 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

iPlanet on HP-UX - WANT to auth aganist MS Directory Services/LDAP

I am running iPlanet 6 on HP-UX 11, and presently all users can access the site. There are 6000 users accessing the website from an Windows Network. I would like users to access the site, but would also like to log user ID's in the access log, without prompting users for an ID/Password. Is... (1 Reply)
Discussion started by: shuterj
1 Replies

2. AIX

how to check status of various services and port?

How can i check which service is activated on my AIX Box? how one can check particular port is open or not (like ftp/telnet port)? I dont have admin rights (1 Reply)
Discussion started by: ashish4422
1 Replies

3. Shell Programming and Scripting

To Fetch a File From FTP server

Hi all, I need to download a file from ftp server through application server(UNIX server). Which only has sufficient privileges to connect to ftp server. And from that server( app server) i have to get that downloaded file in to my current UNIX server(working server where i am working). we... (5 Replies)
Discussion started by: dvk121
5 Replies

4. UNIX and Linux Applications

Server migration from samba+ldap to windows server 2003

Hi, i have a server installed samba+openldap (pdc). Need to migration windows server 2003 (active directory) object users, computers. Where you can read how to do it? Or can tell me how to do it? Thanks. P.S. Sorry for bad english (0 Replies)
Discussion started by: ap0st0l
0 Replies

5. Shell Programming and Scripting

How to fetch File from a URL to Unix Server?

Hello All, I wanted to get the software to be fetched from the Service Provide URL to my unix server. I tired using the mget, but resulted in error. Please take a look. $ wget -O V3-0-5-2.Solaris8-SPARC.tar.gz --http-user=hd87es3 --http-passwd=987dnja7 http://beyond.abinitio.com... (3 Replies)
Discussion started by: raghunsi
3 Replies

6. Ubuntu

what port number is used for SSH communication and HTTPS services

I am trying to find out what port number is used for SSH communication and HTTPS services in my Ubuntu OS. Thank you, Crim (1 Reply)
Discussion started by: crimputt
1 Replies

7. Shell Programming and Scripting

Fetch the different data by searching with a same variable from a file in AIX server

Hi, I am trying to fetch the different values in an xml file by searching with the same variable in AIX Server. <name>SharedResources/Shared/JNDI/Username</name> <value>admin</value> <name>SharedResources/Shared/JNDI/Username</name> ... (1 Reply)
Discussion started by: tejastrikez
1 Replies

8. Red Hat

Restart of services if port no is changed in /etc/services in RHEL

I had a doubt if any services need to be restarted if port no in /etc/services in an RHEL setup is changed. For eg, the port no of 443 for SSL may need to be changed. I hope my query is clear whether any services need to be restarted if port no in /etc/services is changed. Please revert with... (10 Replies)
Discussion started by: RHCE
10 Replies

9. HP-UX

How to fetch all running services on HP-UX?

Hi All, I have a requirement to get all the running services on few HP-UX boxes. In Linux systems I am able to do that successfully using: chkconfig --list. However I can't find anything equivalent in HP-UX. If anyone has any pointers on the same then please suggest. Adyan (4 Replies)
Discussion started by: Adyan Faruqi
4 Replies

10. Solaris

LDAP Client not connecting to LDAP server

I have very limited knowledge on LDAP configuration and have been trying fix one issue, but unsuccessful. The server, I am working on, is Solaris-10 zone. sudoers is configured on LDAP (its not on local server). I have access to login directly on server with root, but somehow sudo is not working... (9 Replies)
Discussion started by: solaris_1977
9 Replies
ldaplist(1)							   User Commands						       ldaplist(1)

NAME
ldaplist - search and list naming information from an LDAP directory using the configured profile SYNOPSIS
/usr/bin/ldaplist [-dlv] [database [key]...] /usr/bin/ldaplist -h DESCRIPTION
The ldaplist utility searches for and lists the naming information from the LDAP directory service defined in the LDAP configuration files generated by ldapclient(1M) during the client initialization phase. The Solaris LDAP client must be set up in order to use this utility. The database is either a container name or a database name as defined in nsswitch.conf(4). A container is a non-leaf entry in the Directory Information Tree (DIT) that contains naming service information. The container name is the LDAP Relative Distinguished Name (RDN) of the container relative to the defaultSearchBase as defined in the configuration files. For example, for a container named ou=people, the data- base name is the database specified in nsswitch.conf. This database is mapped to a container, for example, passwd maps to ou=people. If an invalid database is specified, it will be mapped to a generic container, for example, nisMapName=name). The key is the attribute value to be searched in the database. You can specify more than one key to be searched in the same database. The key can be specified in either of two forms: attribute=value or value. In the first case, ldaplist passes the search key to the server. In the latter case, an attribute is assigned depending on how the database is specified. If the database is a container name, then the "cn" attribute type is used. If the database is a valid database name as defined in the nsswitch.conf, then a predefined attribute type is used (see table below). If the database is an invalid database name, then cn is used as the attribute type. The ldaplist utility relies on the Schema defined in the RFC 2307bis, currently an IETF draft. The data stored on the LDAP server must be stored based on this Schema, unless the profile contains schema mapping definitions. For more information on schema mapping see ldap- client(1M). The following table lists the default mapping from the database names to the container, the LDAP object class, and the attribute type used if not defined in the key. Database Object Class Attribute Type Container aliases mailGroup cn ou=Aliases automount nisObject cn automountMapName=auto_* bootparams bootableDevice cn ou=Ethers ethers ieee802Device cn ou=Ethers group posixgroup cn ou=Group hosts ipHost cn ou=Hosts ipnodes ipHost cn ou=Hosts netgroup ipNetgroup cn ou=Netgroup netmasks ipNetwork ipnetworknumber ou=Networks networks ipNetwork ipnetworknumber ou=Networks passwd posixAccount uid ou=People protocols ipProtocol cn ou=Protocols publickey nisKeyObject uidnumber ou=People cn ou=Hosts rpc oncRpc cn ou=Rpc services ipService cn ou=Services printers printerService printer-uri ou=printers auth_attr SolarisAuthAttr nameT ou=SolarisAuthAttr prof_attr SolarisProfAttr nameT ou=SolarisProfAttr exec_attr SolarisExecAttr nameT ou=SolarisProfAttr user_attr SolarisUserAttr uidT ou=people audit_user SolarisAuditUser uidT ou=people o For the automount database, auto_*, in the container column, represents auto_home, auto_direct, ... o For the publickey database, if the key starts with a digit, it will be interpreted as an uid number. If the key starts with a non- digit, it will be interpreted as a host name. The ldaplist utility supports substring search by using the wildcard "*" in the key. For example, "my*" will match any strings that starts with "my". In some shell environments, keys containing the wildcard may need to be quoted. If the key is not specified, all the containers in the current search baseDN will be listed. OPTIONS
The following options are supported: -d Lists the attributes for the specified database, rather than the entries. By default, the entries are listed. -h Lists the database mapping. -l Lists all the attributes for each entry matching the search criteria. By default, ldaplist lists only the Distinguished Name of the entries found. -v Sets verbose mode. The ldaplist utility will also print the filter used to search for the entry. The filter will be prefixed with "+++". EXAMPLES
Example 1: Listing All Entries in the Hosts Database example% ldaplist hosts Example 2: Listing All Entries in a Non-Standard Database ou=new example% ldaplist ou=new Example 3: Finding "user1" in the passwd Database example% ldaplist passwd user1 Example 4: Finding the Entry With Service Port of 4045 in the services Database example% ldaplist services ipServicePort=4045 Example 5: Finding All Users With Username Starting with new in the passwd Database example% ldaplist passwd 'new*' Example 6: Listing the Attributes for the hosts Database example% ldaplist -d hosts EXIT STATUS
The following exit values are returned: 0 Successfully matched some entries. 1 Successfully searched the table and no matches were found. 2 An error occurred. An error message is output. FILES
/var/ldap/ldap_client_file Files that contain the LDAP configuration of the client. Do not manually modify these files. Their content /var/ldap/ldap_client_cred is not guaranteed to be human readable. To update these files, use ldapclient(1M) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
ldap(1), ldapadd(1), ldapdelete(1), ldapmodify(1), ldapmodrdn(1), ldapsearch(1), idsconfig(1M), ldap_cachemgr(1M), ldapaddent(1M), ldap- client(1M), suninstall(1M), resolv.conf(4), attributes(5) NOTES
RFC 2307bis is an IETF informational document in draft stage that defines an approach for using LDAP as a naming service. SunOS 5.10 16 Jan 2004 ldaplist(1)
All times are GMT -4. The time now is 08:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy