Tecnologia da Informação - TI : Install OpenLDAP Server

Total de visualizações de página

Mostrando postagens com marcador Install OpenLDAP Server. Mostrar todas as postagens
Mostrando postagens com marcador Install OpenLDAP Server. Mostrar todas as postagens

segunda-feira, 18 de abril de 2016

Configure IPA Server to share users' account in your local network




Configure IPA Server to share users' account in your local network.
[1]Install FreeIPA.
[root@dlp ~]# 
yum -y install ipa-server bind bind-dyndb-ldap
[2]Setup FreeIPA Server.
[root@dlp ~]# 
vi /etc/hosts
# add own IP

10.0.0.30   dlp.server.world dlp

[root@dlp ~]# 
ipa-server-install --setup-dns 

The log file for this installation can be found in /var/log/ipaserver-install.log
==============================================================================
This program will set up the IPA Server.

This includes:
  * Configure a stand-alone CA (dogtag) for certificate management
  * Configure the Network Time Daemon (ntpd)
  * Create and configure an instance of Directory Server
  * Create and configure a Kerberos Key Distribution Center (KDC)
  * Configure Apache (httpd)

To accept the default shown in brackets, press the Enter key.

# setup DNS (existing BIND settings is over-written)

Existing BIND configuration detected, overwrite? [no]: 
yes

Enter the fully qualified domain name of the computer
on which you're setting up server software. Using the form
<hostname>.<domainname>
Example: master.example.com.

# confirm the hostname and Enter

Server host name [dlp.server.world]:

The domain name has been determined based on the host name.

# confirm the domain name and Enter

Please confirm the domain name [server.world]:

The kerberos protocol requires a Realm name to be defined.
This is typically the domain name converted to uppercase.

# confirm realm name and Enter

Please provide a realm name [SERVER.WORLD]:
Certain directory server operations require an administrative user.
This user is referred to as the Directory Manager and has full access
to the Directory for system management tasks and will be added to the
instance of directory server created for IPA.
The password must be at least 8 characters long.

# Directory Manager's password

Directory Manager password:
Password (confirm):

The IPA server requires an administrative user, named 'admin'.
This user is a regular system account used for IPA server administration.

# IPA admin's password

IPA admin password:
Password (confirm):

# answer with yes or no for setting DNS forwarder

Do you want to configure DNS forwarders? [yes]:
Enter the IP address of DNS forwarder to use, or press Enter to finish.
# specify DNS forwarder's IP if you set DNS forwarder

Enter IP address for a DNS forwarder: 
10.0.0.10

DNS forwarder 10.0.0.10 added
# Enter with empty if DNS forwarder is OK

Enter IP address for a DNS forwarder:
# answer with yes or no for setting reverse zone

Do you want to configure the reverse zone? [yes]:
# reverse zone name if you set reverse zone

Please specify the reverse zone name [0.0.10.in-addr.arpa.]:
The IPA Master Server will be configured with:
Hostname:      dlp.server.world
IP address:    10.0.0.30
Domain name:   server.world
Realm name:    SERVER.WORLD

BIND DNS server will be configured to serve IPA domain with:
Forwarders:    10.0.0.10
Reverse zone:  0.0.10.in-addr.arpa.

# confirm settings and proceed with "yes"

Continue to configure the system with these values? [no]: 
yes

The following operations may take some minutes to complete.
Please wait until the prompt is returned.

Configuring NTP daemon (ntpd)
...
...
...
==============================================================================
Setup complete

Next steps:
        1. You must make sure these network ports are open:
                TCP Ports:
                  * 80, 443: HTTP/HTTPS
                  * 389, 636: LDAP/LDAPS
                  * 88, 464: kerberos
                UDP Ports:
                  * 88, 464: kerberos
                  * 123: ntp

        2. You can now obtain a kerberos ticket using the command: 'kinit admin'
           This ticket will allow you to use the IPA tools (e.g., ipa user-add)
           and the web user interface.

Be sure to back up the CA certificate stored in /root/cacert.p12
This file is required to create replicas. The password for this
file is the Directory Manager password
[3]Get Kerberos tickets and change default shell.
[root@dlp ~]# 
kinit admin 

Password for admin@SERVER.WORLD:
# IPA admin password

[root@dlp ~]# 
klist 
# confirm

Ticket cache: KEYRING:persistent:0:0
Default principal: admin@SERVER.WORLD

Valid starting       Expires              Service principal
03/21/2015 14:25:53  03/24/2015 14:25:50  krbtgt/SERVER.WORLD@SERVER.WORLD

[root@dlp ~]# 
ipa config-mod --defaultshell=/bin/bash 

  Maximum username length: 32
  Home directory base: /home
  Default shell: /bin/bash
  Default users group: ipausers
  Default e-mail domain: server.world
  Search time limit: 2
  Search size limit: 100
  User search fields: uid,givenname,sn,telephonenumber,ou,title
  Group search fields: cn,description
  Enable migration mode: FALSE
  Certificate Subject base: O=SERVER.WORLD
  Password Expiration Notification (days): 4
  Password plugin features: AllowNThash
  SELinux user map order: guest_u:s0$xguest_u:s0$user_u:s0$staff_u:s0-s0:c0.c1023$unconfined_u:s0-s0:c0.c1023
  Default SELinux user: unconfined_u:s0-s0:c0.c1023
  Default PAC types: MS-PAC

Configure OpenLDAP Multi-Master Replication




Configure OpenLDAP Multi-Master Replication.
For the Settings of Provider/Consumer, it's impossible to add datas on Consumer server, but if configure this Multi-Master Settings, it's possbile to add on any Master server.
[1]
[2]Configure like follows on all servers. Add syncprov module.
[root@slapd01 ~]# 
vi mod_syncprov.ldif
# create new

dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib64/openldap
olcModuleLoad: syncprov.la

[root@slapd01 ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f mod_syncprov.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=module,cn=config"

[root@slapd01 ~]# 
vi syncprov.ldif
# create new

dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100

[root@slapd01 ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "olcOverlay=syncprov,olcDatabase={2}hdb,cn=config"
[3]Configure like follows on all servers. But only the parameters "olcServerID" and "provider=***", set different value on each server.
[root@slapd01 ~]# 
vi master01.ldif
# create new

dn: cn=config
changetype: modify
replace: olcServerID
# specify uniq ID number on each server

olcServerID: 0

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=001
  
# specify another LDAP server's URI

  provider=ldap://10.0.0.50:389/
  bindmethod=simple
  
  
# own domain name

  binddn="cn=Manager,dc=server,dc=world"
  
# directory manager's password

  credentials=password
  searchbase="dc=server,dc=world"
  
# includes subtree

  scope=sub
  schemachecking=on
  type=refreshAndPersist
  
# [retry interval] [retry times] [interval of re-retry] [re-retry times]

  retry="30 5 300 3"
  
# replication interval

  interval=00:00:05:00
-
add: olcMirrorMode
olcMirrorMode: TRUE

dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
changetype: add
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov

[root@slapd01 ~]# 
ldapmodify -Y EXTERNAL -H ldapi:/// -f master01.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

adding new entry "olcOverlay=syncprov,olcDatabase={2}hdb,cn=config"
[4]Configure LDAP Client to bind all LDAP server.
[root@www ~]# 
authconfig --ldapserver=slapd01.server.world,slapd02.server.world --update 

Configure OpenLDAP Replication to continue Directory




Configure OpenLDAP Replication to continue Directory service if OpenLDAP master server would be down. OpenLDAP master server is called "Provider" and OpenLDAP Slave server is called "Consumer" on OpenLDAP.
[1]
[2]Configure LDAP Provider. Add syncprov module.
[root@dlp ~]# 
vi mod_syncprov.ldif
# create new

dn: cn=module,cn=config
objectClass: olcModuleList
cn: module
olcModulePath: /usr/lib64/openldap
olcModuleLoad: syncprov.la

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f mod_syncprov.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=module,cn=config"

[root@dlp ~]# 
vi syncprov.ldif
# create new

dn: olcOverlay=syncprov,olcDatabase={2}hdb,cn=config
objectClass: olcOverlayConfig
objectClass: olcSyncProvConfig
olcOverlay: syncprov
olcSpSessionLog: 100

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f syncprov.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "olcOverlay=syncprov,olcDatabase={2}hdb,cn=config"
[3]Configure LDAP Consumer.
[root@slave ~]# 
vi syncrepl.ldif
# create new

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcSyncRepl
olcSyncRepl: rid=001
  
# LDAP server's URI

  provider=ldap://10.0.0.30:389/
  bindmethod=simple
  
# own domain name

  binddn="cn=Manager,dc=server,dc=world"
  
# directory manager's password

  credentials=password
  searchbase="dc=server,dc=world"
  
# includes subtree

  scope=sub
  schemachecking=on
  type=refreshAndPersist
  
# [retry interval] [retry times] [interval of re-retry] [re-retry times]

  retry="30 5 300 3"
  
# replication interval

  interval=00:00:05:00

[root@slave ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f syncrepl.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={2}hdb,cn=config"

# confirm settings to search datas

[root@slave ~]# 
ldapsearch -x -b 'ou=People,dc=server,dc=world' 

# People, server.world
dn: ou=People,dc=server,dc=world
objectClass: organizationalUnit
ou: People
...
...
[4]Configure LDAP Client to bind LDAP Consumer, too.
[root@www ~]# 
authconfig --ldapserver=dlp.server.world,slave.server.world --update 

Configure LDAP over TLS to make connection




Configure LDAP over TLS to make connection be secure.
[1]
[2]Configure LDAP Server.
[root@dlp ~]# 
cp /etc/pki/tls/certs/server.key \
/etc/pki/tls/certs/server.crt \
/etc/pki/tls/certs/ca-bundle.crt \
/etc/openldap/certs/ 

[root@dlp ~]# 
chown ldap. /etc/openldap/certs/server.key \
/etc/openldap/certs/server.crt \
/etc/openldap/certs/ca-bundle.crt
[root@dlp ~]# 
vi mod_ssl.ldif
# create new

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/openldap/certs/ca-bundle.crt
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/server.crt
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/server.key

[root@dlp ~]# 
ldapmodify -Y EXTERNAL -H ldapi:/// -f mod_ssl.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"

[root@dlp ~]# 
vi /etc/sysconfig/slapd
# line 9: add

SLAPD_URLS="ldapi:/// ldap:/// 
ldaps:///
"
[root@dlp ~]# 
systemctl restart slapd 
[3]Configure LDAP Client for TLS connection.
[root@www ~]# 
echo "TLS_REQCERT allow" >> /etc/openldap/ldap.conf 

[root@www ~]# 
echo "tls_reqcert allow" >> /etc/nslcd.conf 
[root@www ~]# 
authconfig --enableldaptls --update 

getsebool: SELinux is disabled
[root@www ~]# 
exit 

logout
CentOS Linux 7 (Core)
Kernel 3.10.0-123.20.1.el7.x86_64 on an x86_64
www login: 
redhat 

Password:
Last login: Tue Aug 19 19:55:52 on ttyS0
[redhat@www ~]$ 
# logined normally

Configure LDAP Client in order to share users




Configure LDAP Client in order to share users' accounts in your local networks.
[1]Install OpenLDAP Client.
[root@www ~]# 
yum -y install openldap-clients nss-pam-ldapd
# ldapserver=(LDAP server's hostname or IP address)

# ldapbasedn="dc=(your own domain name)"

[root@www ~]# 
authconfig --enableldap \
--enableldapauth \
--ldapserver=dlp.server.world \
--ldapbasedn="dc=server,dc=world" \
--enablemkhomedir \
--update
[root@www ~]# 
exit 

logout
CentOS Linux 7 (Core)
Kernel 3.10.0-123.20.1.el7.x86_64 on an x86_64
www login: 
redhat 
# LDAP user

Password:
# password

Creating directory '/home/redhat'.
[redhat@www ~]$
# logined normally
[redhat@www ~]$ 
# try to change the LDAP password

Changing password for user redhat.
Enter login(LDAP) password: 
# current password

New password: 
# new password

Retype new password:
LDAP password information changed for redhat
passwd: all authentication tokens updated successfully.
[2]If SELinux is enabled, it needs to add a rule to allow creating home directories automatically by mkhomedir.
[root@www ~]# 
vi mkhomedir.te
# create new

module mkhomedir 1.0;

require {
        type unconfined_t;
        type oddjob_mkhomedir_exec_t;
        class file entrypoint;
}

#============= unconfined_t ==============
allow unconfined_t oddjob_mkhomedir_exec_t:file entrypoint;

[root@www ~]# 
checkmodule -m -M -o mkhomedir.mod mkhomedir.te 

checkmodule: loading policy configuration from mkhomedir.te
checkmodule: policy configuration loaded
checkmodule: writing binary representation (version 17) to mkhomedir.mod
[root@www ~]# 
semodule_package --outfile mkhomedir.pp --module mkhomedir.mod 

[root@www ~]# 
semodule -i mkhomedir.pp 

Add LDAP User Accounts in the OpenLDAP Server




Add LDAP User Accounts in the OpenLDAP Server.
[1]Add a user.
# generate encrypted password

[root@dlp ~]# 
slappasswd 

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxx
[root@dlp ~]# 
vi ldapuser.ldif
# create new
# replace to your own domain name for "dc=***,dc=***" section
dn: uid=cent,ou=People,dc=server,dc=world
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: shadowAccount
cn: Cent
sn: Linux
userPassword: {SSHA}xxxxxxxxxxxxxxxxx
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
homeDirectory: /home/cent

dn: cn=cent,ou=Group,dc=server,dc=world
objectClass: posixGroup
cn: Cent
gidNumber: 1000
memberUid: cent

[root@dlp ~]# 
ldapadd -x -D cn=Manager,dc=server,dc=world -W -f ldapuser.ldif 

Enter LDAP Password:
adding new entry "uid=cent,ou=People,dc=server,dc=world"

adding new entry "cn=cent,ou=Group,dc=server,dc=world"
[2]Add users and groups in local passwd/group to LDAP directory.
[root@dlp ~]# 
vi ldapuser.sh
# extract local users and groups who have 1000-9999 digit UID
# replace "SUFFIX=***" to your own domain name
# this is an example
#!/bin/bash

SUFFIX='dc=server,dc=world'
LDIF='ldapuser.ldif'

echo -n > $LDIF
GROUP_IDS=()
grep "x:[1-9][0-9][0-9][0-9]:" /etc/passwd | (while read TARGET_USER
do
    USER_ID="$(echo "$TARGET_USER" | cut -d':' -f1)"

    USER_NAME="$(echo "$TARGET_USER" | cut -d':' -f5 | cut -d' ' -f1,2)"
    [ ! "$USER_NAME" ] && USER_NAME="$USER_ID"

    LDAP_SN="$(echo "$USER_NAME" | cut -d' ' -f2)"

    LASTCHANGE_FLAG="$(grep "${USER_ID}:" /etc/shadow | cut -d':' -f3)"
    [ ! "$LASTCHANGE_FLAG" ] && LASTCHANGE_FLAG="0"

    SHADOW_FLAG="$(grep "${USER_ID}:" /etc/shadow | cut -d':' -f9)"
    [ ! "$SHADOW_FLAG" ] && SHADOW_FLAG="0"

    GROUP_ID="$(echo "$TARGET_USER" | cut -d':' -f4)"
    [ ! "$(echo "${GROUP_IDS[@]}" | grep "$GROUP_ID")" ] && GROUP_IDS=("${GROUP_IDS[@]}" "$GROUP_ID")

    echo "dn: uid=$USER_ID,ou=People,$SUFFIX" >> $LDIF
    echo "objectClass: inetOrgPerson" >> $LDIF
    echo "objectClass: posixAccount" >> $LDIF
    echo "objectClass: shadowAccount" >> $LDIF
    echo "sn: $LDAP_SN" >> $LDIF
    echo "givenName: $(echo "$USER_NAME" | awk '{print $1}')" >> $LDIF
    echo "cn: $USER_NAME" >> $LDIF
    echo "displayName: $USER_NAME" >> $LDIF
    echo "uidNumber: $(echo "$TARGET_USER" | cut -d':' -f3)" >> $LDIF
    echo "gidNumber: $(echo "$TARGET_USER" | cut -d':' -f4)" >> $LDIF
    echo "userPassword: {crypt}$(grep "${USER_ID}:" /etc/shadow | cut -d':' -f2)" >> $LDIF
    echo "gecos: $USER_NAME" >> $LDIF
    echo "loginShell: $(echo "$TARGET_USER" | cut -d':' -f7)" >> $LDIF
    echo "homeDirectory: $(echo "$TARGET_USER" | cut -d':' -f6)" >> $LDIF
    echo "shadowExpire: $(passwd -S "$USER_ID" | awk '{print $7}')" >> $LDIF
    echo "shadowFlag: $SHADOW_FLAG" >> $LDIF
    echo "shadowWarning: $(passwd -S "$USER_ID" | awk '{print $6}')" >> $LDIF
    echo "shadowMin: $(passwd -S "$USER_ID" | awk '{print $4}')" >> $LDIF
    echo "shadowMax: $(passwd -S "$USER_ID" | awk '{print $5}')" >> $LDIF
    echo "shadowLastChange: $LASTCHANGE_FLAG" >> $LDIF
    echo >> $LDIF
done

for TARGET_GROUP_ID in "${GROUP_IDS[@]}"
do
    LDAP_CN="$(grep ":${TARGET_GROUP_ID}:" /etc/group | cut -d':' -f1)"

    echo "dn: cn=$LDAP_CN,ou=Group,$SUFFIX" >> $LDIF
    echo "objectClass: posixGroup" >> $LDIF
    echo "cn: $LDAP_CN" >> $LDIF
    echo "gidNumber: $TARGET_GROUP_ID" >> $LDIF

    for MEMBER_UID in $(grep ":${TARGET_GROUP_ID}:" /etc/passwd | cut -d':' -f1,3)
    do
        UID_NUM=$(echo "$MEMBER_UID" | cut -d':' -f2)
        [ $UID_NUM -ge 1000 -a $UID_NUM -le 9999 ] && echo "memberUid: $(echo "$MEMBER_UID" | cut -d':' -f1)" >> $LDIF
    done
    echo >> $LDIF
done
)

[root@dlp ~]# 
sh ldapuser.sh 

[root@dlp ~]# 
ldapadd -x -D cn=Manager,dc=server,dc=world -W -f ldapuser.ldif 

Enter LDAP Password:
adding new entry "uid=cent,ou=People,dc=server,dc=world"
adding new entry "uid=redhat,ou=People,dc=server,dc=world"
adding new entry "uid=ubuntu,ou=People,dc=server,dc=world"
adding new entry "uid=debian,ou=People,dc=server,dc=world"
adding new entry "cn=cent,ou=Group,dc=server,dc=world"
adding new entry "cn=redhat,ou=Group,dc=server,dc=world"
adding new entry "cn=ubuntu,ou=Group,dc=server,dc=world"
adding new entry "cn=debian,ou=Group,dc=server,dc=world"
[3]If you'd like to delete LDAP User or Group, Do as below.
[root@dlp ~]# 
ldapdelete -x -W -D 'cn=Manager,dc=server,dc=world' "uid=cent,ou=People,dc=server,dc=world" 

Enter LDAP Password:
[root@dlp ~]# 
ldapdelete -x -W -D 'cn=Manager,dc=server,dc=world' "cn=cent,ou=Group,dc=server,dc=world" 

Enter LDAP Password:

Configure LDAP Server


Configure LDAP Server
2015/04/15
 
Configure LDAP Server in order to share users' accounts in your local networks.
[1]Install OpenLDAP Server.
[root@dlp ~]# 
yum -y install openldap-servers openldap-clients
[root@dlp ~]# 
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG 

[root@dlp ~]# 
chown ldap. /var/lib/ldap/DB_CONFIG 

[root@dlp ~]# 
systemctl start slapd 

[root@dlp ~]# 
systemctl enable slapd 
[2]Set OpenLDAP admin password.
# generate encrypted password

[root@dlp ~]# 
slappasswd 

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx
[root@dlp ~]# 
vi chrootpw.ldif
# specify the password generated above for "olcRootPW" section

dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={0}config,cn=config"
[3]Import basic Schemas.
[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=cosine,cn=schema,cn=config"

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=nis,cn=schema,cn=config"

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=inetorgperson,cn=schema,cn=config"
[4]Set your domain name on LDAP DB.
# generate directory manager's password

[root@dlp ~]# 
slappasswd 

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx
[root@dlp ~]# 
vi chdomain.ldif
# replace to your own domain name for "dc=***,dc=***" section

# specify the password generated above for "olcRootPW" section

dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth"
  read by dn.base="cn=Manager,dc=server,dc=world" read by * none

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=server,dc=world

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=server,dc=world

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by
  dn="cn=Manager,dc=server,dc=world" write by anonymous auth by self write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=Manager,dc=server,dc=world" write by * read

[root@dlp ~]# 
ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={1}monitor,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

[root@dlp ~]# 
vi basedomain.ldif
# replace to your own domain name for "dc=***,dc=***" section

dn: dc=server,dc=world
objectClass: top
objectClass: dcObject
objectclass: organization
o: Server World
dc: Server

dn: cn=Manager,dc=server,dc=world
objectClass: organizationalRole
cn: Manager
description: Directory Manager

dn: ou=People,dc=server,dc=world
objectClass: organizationalUnit
ou: People

dn: ou=Group,dc=server,dc=world
objectClass: organizationalUnit
ou: Group

[root@dlp ~]# 
ldapadd -x -D cn=Manager,dc=server,dc=world -W -f basedomain.ldif 

Enter LDAP Password: 
# directory manager's password

adding new entry "dc=server,dc=world"

adding new entry "cn=Manager,dc=server,dc=world"

adding new entry "ou=People,dc=server,dc=world"

adding new entry "ou=Group,dc=server,dc=world"
[5]If Firewalld is running, allow LDAP service. LDAP uses 389/TCP.
[root@dlp ~]# 
firewall-cmd --add-service=ldap --permanent 

success
[root@dlp ~]# 
firewall-cmd --reload 

success

Configure LDAP Server


Configure LDAP Server
2015/04/15
 
Configure LDAP Server in order to share users' accounts in your local networks.
[1]Install OpenLDAP Server.
[root@dlp ~]# 
yum -y install openldap-servers openldap-clients
[root@dlp ~]# 
cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG 

[root@dlp ~]# 
chown ldap. /var/lib/ldap/DB_CONFIG 

[root@dlp ~]# 
systemctl start slapd 

[root@dlp ~]# 
systemctl enable slapd 
[2]Set OpenLDAP admin password.
# generate encrypted password

[root@dlp ~]# 
slappasswd 

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx
[root@dlp ~]# 
vi chrootpw.ldif
# specify the password generated above for "olcRootPW" section

dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f chrootpw.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={0}config,cn=config"
[3]Import basic Schemas.
[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=cosine,cn=schema,cn=config"

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=nis,cn=schema,cn=config"

[root@dlp ~]# 
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=inetorgperson,cn=schema,cn=config"
[4]Set your domain name on LDAP DB.
# generate directory manager's password

[root@dlp ~]# 
slappasswd 

New password:
Re-enter new password:
{SSHA}xxxxxxxxxxxxxxxxxxxxxxxx
[root@dlp ~]# 
vi chdomain.ldif
# replace to your own domain name for "dc=***,dc=***" section

# specify the password generated above for "olcRootPW" section

dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth"
  read by dn.base="cn=Manager,dc=server,dc=world" read by * none

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=server,dc=world

dn: olcDatabase={2}hdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=Manager,dc=server,dc=world

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcRootPW
olcRootPW: {SSHA}xxxxxxxxxxxxxxxxxxxxxxxx

dn: olcDatabase={2}hdb,cn=config
changetype: modify
add: olcAccess
olcAccess: {0}to attrs=userPassword,shadowLastChange by
  dn="cn=Manager,dc=server,dc=world" write by anonymous auth by self write by * none
olcAccess: {1}to dn.base="" by * read
olcAccess: {2}to * by dn="cn=Manager,dc=server,dc=world" write by * read

[root@dlp ~]# 
ldapmodify -Y EXTERNAL -H ldapi:/// -f chdomain.ldif 

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "olcDatabase={1}monitor,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

modifying entry "olcDatabase={2}hdb,cn=config"

[root@dlp ~]# 
vi basedomain.ldif
# replace to your own domain name for "dc=***,dc=***" section

dn: dc=server,dc=world
objectClass: top
objectClass: dcObject
objectclass: organization
o: Server World
dc: Server

dn: cn=Manager,dc=server,dc=world
objectClass: organizationalRole
cn: Manager
description: Directory Manager

dn: ou=People,dc=server,dc=world
objectClass: organizationalUnit
ou: People

dn: ou=Group,dc=server,dc=world
objectClass: organizationalUnit
ou: Group

[root@dlp ~]# 
ldapadd -x -D cn=Manager,dc=server,dc=world -W -f basedomain.ldif 

Enter LDAP Password: 
# directory manager's password

adding new entry "dc=server,dc=world"

adding new entry "cn=Manager,dc=server,dc=world"

adding new entry "ou=People,dc=server,dc=world"

adding new entry "ou=Group,dc=server,dc=world"
[5]If Firewalld is running, allow LDAP service. LDAP uses 389/TCP.
[root@dlp ~]# 
firewall-cmd --add-service=ldap --permanent 

success
[root@dlp ~]# 
firewall-cmd --reload 

success

Console Sony Playstation 5 Edição Slim Disk 1tb Branco + Controle Sem Fio Dualsense Ps5 Branco

https://meli.la/1pJv7oL LINK ->  https://meli.la/1pJv7oL  Características do produto Capacidade 1 TB Com Wi-Fi Sim Tipo de console De ...