twitter
    Find out what I'm doing, Follow Me :)

Wednesday, April 20, 2011

NTP SERVER AND CLIENT CONFIGURATION

====================================================================
Configure NTP Server
====================================================================
Note: NTP server IP:192.168.2.40
         NTP client2 IP: 192.168.2.2
         NTP client2 IP: 192.168.2.2

# Make sure to install ntp

** Step To create NTP server

# chkconfig ntpd on

# edit /etc/ntp.conf

    --> add this line :

                             peer 192.168.2.2
                             peer 192.168.2.3

# edit /etc/sysconfig/iptables

    --> please enable port 123

# restart ntpd

    --> /etc/init.d/ntpd restart

# restart firewall

    --> /etc/init.d/iptables restart
=======================================================================
** To configure NTP client to syn with NTP server
=======================================================================
# edit /etc/ntp.conf

    --> add this line :

                        restrict 192.168.2.40 mask 255.255.255.0 nomodify notrap noquery
  
                        server 192.168.2.40

                        ** comment out others restrict ..... mask 255.255.255.0 nomodify notrap noquery

# edit /etc/ntp/ntpservers

    --> add this line :

                        192.168.2.40

                        ** comment out others server IP/url

# edit /etc/ntp/step-tickers

    --> add this line :

                        192.168.2.40


# edit /etc/sysconfig/iptables

     --> please enable port 123

# restart ntpd

      --> /etc/init.d/ntpd restart

# restart firewall

      --> /etc/init.d/iptables restart

# fire this command to set the local date and time:

                       ntpdate -u server_IP

# fire this command to query the NTP server-client synchronisation:

                       ntpq -pn

****************************************************************************
****************************************************************************
TESTING

SERVER
# update the time and date

CLIENT
# fire command : ntpdate -u 192.168.2.40
# fire comamnd : ntpq -pn

Creadit to chikaro Natrah

Friday, April 15, 2011

SSL LDAP how to in Centos

1.Install LDAP
# yum install openldap-servers openldap-clients nss_ldap

2.Copy DB_CONFIG
#cp DB_CONFIG.example /var/lib/ldap/DB_CONFIG

3.Created encrypted password for slapd
# slappasswd
{SSHA}372BLnDbuRFpPdQpKi2SRISPaoQEcQW9

4.copy and pasted above encrypted password into slapd.conf
# rootpw                {crypt}ijFYNcSNctBYg    <--------------replace here

5.Change rootDN and suffix accordingly like below example
suffix          "dc=ezmcom,dc=com"
rootdn        "cn=Administrator,dc=ezmcom,dc=com"
6.uncomment below parts
#vi /etc/openldap/slapd.conf
TLSCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
TLSCertificateFile /etc/pki/tls/certs/slapd.pem
TLSCertificateKeyFile /etc/pki/tls/certs/slapd.pem

7.edit ldap.conf file and change to
#vi /etc/openldap/ldap.conf
base dc=ezmcom,dc=com
uri ldap://127.0.0.1:636
TLS_CACERTDIR /etc/openldap/cacerts   
ssl start_tls

8.Generate an RSA key using below command.
#openssl genrsa -out cert.key 1024
#openssl req -new -key cert.key -out cert.csr
Note:common name should match with ur suffix dc (ezmcom)

9.Generate self-signing certificate using below command
#openssl x509 -req -in cert.csr -days 365 -signkey cert.key -out cert.crt

10.restart ldap
#/etc/init.d/ldap restart

Credit to chikaro Natrah. ehehe