如何在linux中更改打开的ldap defalt端口

如何在linux中更改打开的ldap defalt端口,ldap,openldap,Ldap,Openldap,如何在Linux中更改开放ldap默认端口(389)。 我们现在使用默认端口389,需要将端口更改为新端口。我们怎么能做到呢 database mdb maxsize 1073741824

如何在Linux中更改开放ldap默认端口(389)。 我们现在使用默认端口389,需要将端口更改为新端口。我们怎么能做到呢

database        mdb                                                                                                         
maxsize         1073741824                                                                                                  
suffix          "dc=example,dc=com"                                                                                         
rootdn          "cn=Manager,dc=example,dc=com"                                                                              
# Cleartext passwords, especially for the rootdn, should                                                                    
# be avoid.  See slappasswd(8) and slapd.conf(5) for details.                                                               
# Use of strong authentication encouraged.                                                                                  
rootpw          secret                                                                                                      
# The database directory MUST exist prior to running slapd AND                                                              
# should only be accessible by the slapd and slap tools.                                                                    
# Mode 700 recommended.                                                                                                     
directory       /usr/local/var/openldap-data                                                                                
# Indices to maintain                                                                                                       
index   objectClass     eq 

这由
-h
选项控制到
slapd
。在Debian/Ubuntu上,这是
/etc/default/SLAPD
SLAPD\u服务
选项的值。在其他系统上,它可能位于systemd服务的
ExecStart=
行中,或者任何地方

如果当前的slapd命令类似于:

slapd -h "ldap:/// ldapi:///" -F /etc/ldap/slapd.d
然后只需更改相关URI以包含所需的端口,例如:

slapd -h "ldap://:3389/ ldapi:///" -F /etc/ldap/slapd.d