Category Archives: Open Source

TacacsGUI

TacacsGUI is free access control server for you network devices.

TacacsGUI adalah open source Access Control Server untuk autentikasi perangkat jaringan atau security melalui server tacacs.

[1] Download TacacsGUIĀ  di website resminya ada disni

[2] Lakukan import OVA TacacsGUI, setelah selesai import OVA, login ke server TacacsGUI dengan menggunakan user tacgui, password tacgui.

[3] Setting IP address untuk server tacacs

vi /etc/netplan/01-netcfg.yaml
network:
ethernets:
ens160:
addresses: [10.10.10.10/24]
dhcp4: 'no'
dhcp6: 'no'
gateway4: 10.10.10.1
nameservers:
addresses: ["DNS_Server"]
renderer: networkd
version: 2

[4] Masuk ke Portal TacacsGUI https://10.10.10.10:4443, untuk login nya bisa menggunakan username dan password tacgui

[5] Tahap awal setelah login seharusnya adalah melakukan konfigurasi antara TacacsGUI dengan Device yang akan menjadi target. Masuk ke menu Tacacs Devices – Devices – Add Device

Setelah selesai jangan lupa untuk klik apply

Masukkan ke device list – add device

Untuk TacGUI pilih Device yang sudah di tambahkan di menu Devices

[6] Setting waktu/zone

[7] Mavis Module – Auth LDAP

Tes koneksi LDAP, jika sukses akan muncul seperti di atas

[8] Menambahkan user tacacs – Add user

Banyak fitur pembuatan user ini, bisa di buat untuk grouping, membuat akses list service, akses rule.

Cheers

Advertisements

Webmin

Webmin adalah tools konfigurasi untuk sistem server berbasis web. Di webmin kita dapat memonitor kapasitas memory server atau melihat log internal server dan masih banyak lagi tentang kebutuhan sistem administrator.

[1] Install Webmin dan paket paket yang di perlukan

yum -y install perl-Net-SSLeay
yum -y install http://download.webmin.com/download/yum/webmin-1.900-1.noarch.rpm

Disini bisa memilih versi untuk webmin bisa langsung berkunjung ke situsnya untuk download = webmin

[2] Setelah terinstall lalu masukkan ip yang diijinkan mengakses webmin, tambahkan di paling bawah

vi /etc/webmin/miniserv.conf

allow=127.0.0.1 192.168.10.10/32

Lakukan restart service

/etc/rc.d/init.d/webmin restart

[3] Open akses browser webmin, https://192.168.10.10:10000 , login mengguakan user root dan password root

Cheers

Install dan konfigurasi LogAnalyzer 4

[1] Update System server terlebih dahulu

yum -y update

[2] Install packet yang di butuhkan oleh loganalyzer

yum install httpd php php-mysql wget -y

enable service untuk httpd

systemctl enable httpd && systemctl start httpd

Install mariadb server dan rsyslog-mysql

yum install mariadb-server rsyslog-mysql -y
systemctl enable mariadb && systemctl start mariadb
mysql_secure_installation

[3] Konfigurasi database rsyslog

mysql -u root -p < /usr/share/doc/rsyslog-8.24.0/mysql-createDB.sql 
Enter password:

Membuat user database untuk akses Syslog database

mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 11
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> GRANT ALL ON Syslog.* TO 'rsyslog'@'localhost' IDENTIFIED BY 'YourPassword';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

[4] Konfigurasi rsyslog

Backup terlebih dahulu konfigurasi aslinya

cp /etc/rsyslog.conf /etc/rsyslog.conf.asli

Setelah itu masuk ke vi /etc/rsyslog.conf dan tambahkan konfigurasi seperti di bawah ini

# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514

# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514

# Load the MySQL Module
module(load="ommysql")


*.* :ommysql:127.0.0.1,Syslog,rsyslog,passwordAnda

Restart service

systemctl restart rsyslog

[5] Install LogAnalyzer

Untuk Download bisa akses ke url web nya atau bisa langsung wget, pilih versi yang stable

https://loganalyzer.adiscon.com/downloads/

wget http://download.adiscon.com/loganalyzer/loganalyzer-4.1.6.tar.gz

tar -zxvf loganalyzer-4.1.6.tar.gz

Buat direktori di var/www/html copy direktori src dan contrib nya ke direktory yang sudah di buat

mkdir /var/www/html/loganalyzer
cp -r src/* /var/www/html/loganalyzer/
cp -r contrib/* /var/www/html/loganalyzer/

Buat konfigurasi blank file php di direktori /var/www/html/loganalyzer, dan buat permission nya

touch config.php
chmod +x secure.sh
chown apache:apache config.php
chmod 777 config.php

[6] Buka LogAnalyzer web installer melalui web browser http://YourIPaddress/loganalyzer/

Cheers – Semoga bermanfaat

Install PAC Manager ( Ubuntu )

Perl Auto Connector Manager adalah Open Source GUI Linux yang biasa digunakan untuk me manage ssh, telnet, sftp, rdesktop, vnc, ftp session ke Server.

[1] Install PAC manager

wget http://sourceforge.net/projects/pacmanager/files/pac-4.0/pac-4.5.5.5-all.deb

sudo dpkg -i pac-4.5.5.5-all.deb
(Reading database ... 428047 files and directories currently installed.)
Preparing to unpack pac-4.5.5.5-all.deb ...
Unpacking pac (4.5.5.5) ...
dpkg: dependency problems prevent configuration of pac:
 pac depends on gtk2-engines-pixbuf; however:
 Package gtk2-engines-pixbuf is not installed.
 pac depends on libvte9; however:
 Package libvte9 is not installed.
 pac depends on libexpect-perl; however:
 Package libexpect-perl is not installed.
 pac depends on libnet-proxy-perl; however:
 Package libnet-proxy-perl is not installed.
 pac depends on libyaml-perl; however:
 Package libyaml-perl is not installed.
 pac depends on libcrypt-cbc-perl; however:
 Package libcrypt-cbc-perl is not installed.
 pac depends on libcrypt-blowfish-perl; however:
 Package libcrypt-blowfish-perl is not installed.
 pac depends on libgtk2-gladexml-perl; however:
 Package libgtk2-gladexml-perl is not installed.
 pac depends on libgtk2-ex-simple-list-perl; however:
 Package libgtk2-ex-simple-list-perl is not installed.
 pac depends on libnet-arp-perl; however:
 Package libnet-arp-perl is not installed.
 pac depends on libossp-uuid-perl; however:
 Package libossp-uuid-perl
dpkg: error processing package pac (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Errors were encountered while processing:
 pac

Jika terjadi Error seperti di atas solusi nya adalah seperti di bawah ini

sudo apt-get install -f

[2] Buka PAC Manager

Semoga bermanfaat

uGet ( Open Source Download Manager )

uGet adalah Open Source Download Manager yang support untuk Sistem Operasi Linux.

[1] Install uGet via official uGet PPA

sudo add-apt-repository ppa:plushuang-tw/uget-stable
sudo apt update
sudo apt install uget
space@space:~$ sudo apt install uget
[sudo] password for space: 
Reading package lists... Done
Building dependency tree 
Reading state information... Done
The following packages were automatically installed and are no longer required:
 linux-headers-4.4.0-93 linux-headers-4.4.0-93-generic
 linux-image-4.4.0-93-generic linux-image-extra-4.4.0-93-generic
 linux-signed-image-4.4.0-93-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
 uget
0 upgraded, 1 newly installed, 0 to remove and 285 not upgraded.
Need to get 317 kB of archives.
After this operation, 1.313 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 uget amd64 2.0.2-1ubuntu1 [317 kB]
Fetched 317 kB in 2s (148 kB/s)
Selecting previously unselected package uget.
(Reading database ... 389775 files and directories currently installed.)
Preparing to unpack .../uget_2.0.2-1ubuntu1_amd64.deb ...
Unpacking uget (2.0.2-1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Setting up uget (2.0.2-1ubuntu1) ...

space@space:~$ uget-gt

[2] GUI uGet Download Manager

Semoga bermanfaat – AnditoYugoWicaksono

Cheers..

FreeIPA Server

Konfigurasi IPA Server

[1] Preparing setting server IPA

yum -y update

Install bind-utils untuk cek nama domain sebelum digunakan

yum -y install bind-utils bind bind-dyndb-ldap

Gunakan command dig untuk mengecek Record A

dig +short ipa.zotma.co.id
192.168.10.10

Setting hosts di server

vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.10.10 ipa.zotma.co.id ipa

[2] Install IPA Server

yum -y install ipa-server
[root@ipa ~]# ipa-server-install

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)
 * Configure the KDC to enable PKINIT

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

Do you want to configure integrated DNS (BIND)? [no]: no

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.


Server host name [ipa.zotma.co.id]: ipa.zotma.co.id

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

Please confirm the domain name [zotma.co.id]: ipa.zotma.co.id

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

Please provide a realm name [IPA.ZOTMA.CO.ID]: IPA.ZOTMA.CO.ID
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 password: 
Password must be at least 8 characters long
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 password: 
Password (confirm):


The IPA Master Server will be configured with:
Hostname: ipa.zotma.co.id
IP address(es): 192.168.10.10
Domain name: ipa.zotma.co.id
Realm name: IPA.ZOTMA.CO.ID

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)
 [1/4]: stopping ntpd
 [2/4]: writing configuration
 [3/4]: configuring ntpd to start on boot
 [4/4]: starting ntpd
Done configuring NTP daemon (ntpd).
Configuring directory server (dirsrv). Estimated time: 30 seconds
 [1/45]: creating directory server instance
 [2/45]: enabling ldapi
 [3/45]: configure autobind for root
 [4/45]: stopping directory server
 [5/45]: updating configuration in dse.ldif
 [6/45]: starting directory server
 [7/45]: adding default schema
 [8/45]: enabling memberof plugin
 [9/45]: enabling winsync plugin
 [10/45]: configuring replication version plugin
 [11/45]: enabling IPA enrollment plugin
 [12/45]: configuring uniqueness plugin
 [13/45]: configuring uuid plugin
 [14/45]: configuring modrdn plugin
 [15/45]: configuring DNS plugin
 [16/45]: enabling entryUSN plugin
 [17/45]: configuring lockout plugin
 [18/45]: configuring topology plugin
 [19/45]: creating indices
 [20/45]: enabling referential integrity plugin
 [21/45]: configuring certmap.conf
 [22/45]: configure new location for managed entries
 [23/45]: configure dirsrv ccache
 [24/45]: enabling SASL mapping fallback
 [25/45]: restarting directory server
 [26/45]: adding sasl mappings to the directory
 [27/45]: adding default layout
 [28/45]: adding delegation layout
 [29/45]: creating container for managed entries
 [30/45]: configuring user private groups
 [31/45]: configuring netgroups from hostgroups
 [32/45]: creating default Sudo bind user
 [33/45]: creating default Auto Member layout
 [34/45]: adding range check plugin
 [35/45]: creating default HBAC rule allow_all
 [36/45]: adding entries for topology management
 [37/45]: initializing group membership
 [38/45]: adding master entry
 [39/45]: initializing domain level
 [40/45]: configuring Posix uid/gid generation
 [41/45]: adding replication acis
 [42/45]: activating sidgen plugin
 [43/45]: activating extdom plugin
 [44/45]: tuning directory server
 [45/45]: configuring directory to start on boot
Done configuring directory server (dirsrv).
Configuring Kerberos KDC (krb5kdc)
 [1/10]: adding kerberos container to the directory
 [2/10]: configuring KDC
 [3/10]: initialize kerberos container
WARNING: Your system is running out of entropy, you may experience long delays
 [4/10]: adding default ACIs
 [5/10]: creating a keytab for the directory
 [6/10]: creating a keytab for the machine
 [7/10]: adding the password extension to the directory
 [8/10]: creating anonymous principal
 [9/10]: starting the KDC
 [10/10]: configuring KDC to start on boot
Done configuring Kerberos KDC (krb5kdc).
Configuring kadmin
 [1/2]: starting kadmin 
 [2/2]: configuring kadmin to start on boot
Done configuring kadmin.
Configuring certificate server (pki-tomcatd). Estimated time: 3 minutes
 [1/29]: configuring certificate server instance
 [2/29]: exporting Dogtag certificate store pin
 [3/29]: stopping certificate server instance to update CS.cfg
 [4/29]: backing up CS.cfg
 [5/29]: disabling nonces
 [6/29]: set up CRL publishing
 [7/29]: enable PKIX certificate path discovery and validation
 [8/29]: starting certificate server instance
 [9/29]: configure certmonger for renewals
 [10/29]: requesting RA certificate from CA
 [11/29]: setting up signing cert profile
 [12/29]: setting audit signing renewal to 2 years
 [13/29]: restarting certificate server
 [14/29]: publishing the CA certificate
 [15/29]: adding RA agent as a trusted user
 [16/29]: authorizing RA to modify profiles
 [17/29]: authorizing RA to manage lightweight CAs
 [18/29]: Ensure lightweight CAs container exists
 [19/29]: configure certificate renewals
 [20/29]: configure Server-Cert certificate renewal
 [21/29]: Configure HTTP to proxy connections
 [22/29]: restarting certificate server
 [23/29]: updating IPA configuration
 [24/29]: enabling CA instance
 [25/29]: migrating certificate profiles to LDAP
 [26/29]: importing IPA certificate profiles
 [27/29]: adding default CA ACL
 [28/29]: adding 'ipa' CA entry
 [29/29]: configuring certmonger renewal for lightweight CAs
Done configuring certificate server (pki-tomcatd).
Configuring directory server (dirsrv)
 [1/3]: configuring TLS for DS instance
 [2/3]: adding CA certificate entry
 [3/3]: restarting directory server
Done configuring directory server (dirsrv).
Configuring ipa-otpd
 [1/2]: starting ipa-otpd 
 [2/2]: configuring ipa-otpd to start on boot
Done configuring ipa-otpd.
Configuring ipa-custodia
 [1/5]: Generating ipa-custodia config file
 [2/5]: Making sure custodia container exists
 [3/5]: Generating ipa-custodia keys
 [4/5]: starting ipa-custodia 
 [5/5]: configuring ipa-custodia to start on boot
Done configuring ipa-custodia.
Configuring the web interface (httpd)
 [1/22]: stopping httpd
 [2/22]: setting mod_nss port to 443
 [3/22]: setting mod_nss cipher suite
 [4/22]: setting mod_nss protocol list to TLSv1.0 - TLSv1.2
 [5/22]: setting mod_nss password file
 [6/22]: enabling mod_nss renegotiate
 [7/22]: disabling mod_nss OCSP
 [8/22]: adding URL rewriting rules
 [9/22]: configuring httpd
 [10/22]: setting up httpd keytab
 [11/22]: configuring Gssproxy
 [12/22]: setting up ssl
 [13/22]: configure certmonger for renewals
 [14/22]: importing CA certificates from LDAP
 [15/22]: publish CA cert
 [16/22]: clean up any existing httpd ccaches
 [17/22]: configuring SELinux for httpd
 [18/22]: create KDC proxy config
 [19/22]: enable KDC proxy
 [20/22]: starting httpd
 [21/22]: configuring httpd to start on boot
 [22/22]: enabling oddjobd
Done configuring the web interface (httpd).
Configuring Kerberos KDC (krb5kdc)
 [1/1]: installing X509 Certificate for PKINIT
Done configuring Kerberos KDC (krb5kdc).
Applying LDAP updates
Upgrading IPA:. Estimated time: 1 minute 30 seconds
 [1/9]: stopping directory server
 [2/9]: saving configuration
 [3/9]: disabling listeners
 [4/9]: enabling DS global lock
 [5/9]: starting directory server
 [6/9]: upgrading server
 [7/9]: stopping directory server
 [8/9]: restoring configuration
 [9/9]: starting directory server
Done.
Restarting the KDC
Please add records in this file to your DNS system: /tmp/ipa.system.records.GWAaxa.db
Configuring client side components
Using existing certificate '/etc/ipa/ca.crt'.
Client hostname: ipa.zotma.co.id
Realm: IPA.ZOTMA.CO.ID
DNS Domain: ipa.zotma.co.id
IPA Server: ipa.zotma.co.id
BaseDN: dc=ipa,dc=zotma,dc=co,dc=id

Skipping synchronizing time with NTP server.
New SSSD config will be created
Configured sudoers in /etc/nsswitch.conf
Configured /etc/sssd/sssd.conf
trying https://ipa.zotma.co.id/ipa/json
[try 1]: Forwarding 'schema' to json server 'https://ipa.zotma.co.id/ipa/json'
trying https://ipa.zotma.co.id/ipa/session/json
[try 1]: Forwarding 'ping' to json server 'https://ipa.zotma.co.id/ipa/session/json'
[try 1]: Forwarding 'ca_is_enabled' to json server 'https://ipa.zotma.co.id/ipa/session/json'
Systemwide CA database updated.
Adding SSH public key from /etc/ssh/ssh_host_rsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ecdsa_key.pub
Adding SSH public key from /etc/ssh/ssh_host_ed25519_key.pub
[try 1]: Forwarding 'host_mod' to json server 'https://ipa.zotma.co.id/ipa/session/json'
Could not update DNS SSHFP records.
SSSD enabled
Configured /etc/openldap/ldap.conf
Configured /etc/ssh/ssh_config
Configured /etc/ssh/sshd_config
Configuring ipa.zotma.co.id as NIS domain.
Client configuration complete.
The ipa-client-install command was successful

==============================================================================
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 certificates stored in /root/cacert.p12
These files are required to create replicas. The password for these
files is the Directory Manager password

[3] Check fungsi dari IPA Server

Check terlebih dahulu bahwa Kerberos terinstall dengan benar dengan mencoba menginisialisasi token Kerberos untuk pengguna admin.

[root@ipa ~]# kinit admin
Password for admin@IPA.ZOTMA.CO.ID: 
[root@ipa ~]# klist 
Ticket cache: KEYRING:persistent:0:0
Default principal: admin@IPA.ZOTMA.CO.ID

Valid starting Expires Service principal
11/01/18 15:55:36 12/01/18 15:55:31 krbtgt/IPA.ZOTMA.CO.ID@IPA.ZOTMA.CO.ID

Ok, step yang terakhir verifikasi bahwa server IPA berfungsi dengan benar

[root@ipa ~]# ipa user-find admin
--------------
1 user matched
--------------
 User login: admin
 Last name: Administrator
 Home directory: /home/admin
 Login shell: /bin/bash
 Principal alias: admin@IPA.ZOTMA.CO.ID
 UID: 315600000
 GID: 315600000
 Account disabled: False
----------------------------
Number of entries returned 1
----------------------------

[4] Konfigurasi Firewall Server

firewall-cmd --add-service={ssh,dns,freeipa-ldap,freeipa-ldaps} --permanent 
success

firewall-cmd --reload 
success

[5] Masuk ke url IPA

Untuk check autentikasi nya bisa menggunakan skenario ini Web authentication menggunakan LDAP ( CentOS )

Untuk mengenali DN ldap nya bisa menggunakan cara seperti di bawah ini :

[root@ipa ~]# ldapsearch -x uid=nama
# extended LDIF
#
# LDAPv3
# base <dc=ipa,dc=zotma,dc=co,dc=id> (default) with scope subtree
# filter: uid=nama
# requesting: ALL
#

# nama, users, compat, ipa.zotma.co.id
dn: uid=nama,cn=users,cn=compat,dc=ipa,dc=zotma,dc=co,dc=id
objectClass: posixAccount
objectClass: ipaOverrideTarget
objectClass: top
gecos: nama saya
cn: nama saya
uidNumber: 315600005
gidNumber: 315600005
loginShell: /bin/sh
homeDirectory: /home/nama
ipaAnchorUUID:: OklQQTppcGEuYnJpc3lhcmlhaC5jby5pZDoxNjg2NTIxNi1mN2ExLTExZTctOW
 RmMC0wMDAxYTRhYWNjMWI=
uid: nama

# nama, users, accounts, ipa.zotma.co.id
dn: uid=nama,cn=users,cn=accounts,dc=ipa,dc=zotma,dc=co,dc=id
displayName: nama saya
uid: nama
objectClass: top
objectClass: person
objectClass: organizationalperson
objectClass: inetorgperson
objectClass: inetuser
objectClass: posixaccount
objectClass: krbprincipalaux
objectClass: krbticketpolicyaux
objectClass: ipaobject
objectClass: ipasshuser
objectClass: ipaSshGroupOfPubKeys
objectClass: mepOriginEntry
loginShell: /bin/sh
initials: ns
gecos: nama saya
sn: saya
homeDirectory: /home/nama
givenName: nama
cn: nama saya
uidNumber: 315600005
gidNumber: 315600005

# search result
search: 2
result: 0 Success

# numResponses: 3
# numEntries: 2

Setelah tau DN nya sebagai contoh sudah di beri tanda Bold

cn=users,cn=accounts,dc=ipa,dc=zotma,dc=co,dc=id

lalu tambahkan DN di atas ke dalam konfigurasi, dan lakukan login autentikasi.

Catatan : FreeIPA di atas tidak setup DNS, hanya untuk authentication LDAP user.

Cheers – AnditoYugoWicaksono

Install + Konfigurasi PowerDNS (dengan menggunakan MariaDB) dan PowerAdmin di CentOS 7

PowerDNS adalah DNS yang dikonfigurasi dengan berbagai backend seperti menggunakan relasional database, file zona seperti BIND atau algoritma load balancing / failover. Untuk installasi dan konfigurasinya akan kita bahas di halaman ini :

[1] Install dan Enable EPEL repository

# yum install epel-release -y

[2] Install MariaDB

yum install mariadb mariadb-server -y

# Start dan enable service mariadb
systemctl enable mariadb.service
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

systemctl start mariadb


# Setup MariaDB

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
 SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

[3] Install PowerDNS

# yum install pdns pdns-backend-mysql -y

[4] Koneksikan ke Mysql dan buat database dengan menggunakan nama powerdns

# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database powerdns;
Query OK, 1 row affected (0.00 sec)

Buat user database untuk powerdns

MariaDB [(none)]> GRANT ALL ON powerdns.* TO 'powerdns'@'YourIPServerPowerDNS' IDENTIFIED BY 'PasswordUser';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

Buat tabel database PowerDNS

MariaDB [(none)]> use powerdns;
Database changed
MariaDB [powerdns]> CREATE TABLE domains (id INT auto_increment,name VARCHAR(255) NOT NULL,master VARCHAR(128) DEFAULT NULL,last_check INT DEFAULT NULL,type VARCHAR(6) NOT NULL,notified_serial INT DEFAULT NULL,account VARCHAR(40) DEFAULT NULL,primary key (id));
Query OK, 0 rows affected (0.01 sec)

MariaDB [powerdns]> CREATE UNIQUE INDEX name_index ON domains(name);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [powerdns]> CREATE TABLE records (id INT auto_increment,domain_id INT DEFAULT NULL,name VARCHAR(255) DEFAULT NULL,type VARCHAR(6) DEFAULT NULL,content VARCHAR(255) DEFAULT NULL,ttl INT DEFAULT NULL,prio INT DEFAULT NULL,change_date INT DEFAULT NULL,primary key(id));
Query OK, 0 rows affected (0.00 sec)

MariaDB [powerdns]> CREATE INDEX rec_name_index ON records(name);
Query OK, 0 rows affected (0.01 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [powerdns]> CREATE INDEX nametype_index ON records(name,type);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [powerdns]> CREATE INDEX domain_id ON records(domain_id);
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0

MariaDB [powerdns]> CREATE TABLE supermasters ( ip varchar(25) NOT NULL, nameserver VARCHAR(255) NOT NULL, account VARCHAR(40) DEFAULT NULL);
Query OK, 0 rows affected (0.01 sec)

MariaDB [powerdns]> quit; 
Bye

[5] Open file konfigurasi powerDNS

# vi /etc/pdns/pdns.conf

Tambahkan di baris paling bawah

Enable launch=gmysql

gmysql-host=localhost
gmysql-user=powerdns
gmysql-password="YourPassword"
gmysql-dbname=powerdns

Start dan Enable service PowerDNS

# systemctl start pdns
# systemctl enable pdns
Created symlink from /etc/systemd/system/multi-user.target.wants/pdns.service to /usr/lib/systemd/system/pdns.service.

[6] Install dependency packages sebelum melakukan installasi PowerAdmin

# yum install httpd php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-mhash gettext -y
# yum install php-pear-DB php-pear-MDB2-Driver-mysql -y

Start dan Enable Service httpd

# systemctl start httpd
# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.

[7] Download packet PowerAdmin
Masuk ke direktor, lalu lakukan download packet menggunakan wget

# pwd
/var/www/html

wget https://sourceforge.net/projects/poweradmin/files/poweradmin-2.1.7.tgz

Lakukan extract

# tar xvf poweradmin-2.1.7.tgz

Restart httpd service
# systemctl restart httpd

[8] Open WebBrowser dengan alamat IP Server PowerDNS http://YourIP/poweradmin-2.1.7/install/

Catatan untuk Hostname diisi dengan IPServerPowerDNS

OK, Selanjutnya mengatur akses terbatas ke admin dengan mengeksekusi kode yang diberikan oleh poweradmin di terminal.

# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> GRANT SELECT, INSERT, UPDATE, DELETE ON powerdns.* TO 'poweradmin'@'IP_Server' IDENTIFIED BY 'PasswordUser';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

cd /var/www/html/poweradmin-2.1.7/inc
mv config-me.inc.php config.inc.php
vi config.inc.php

// Database settings
$db_host = 'YourIP_DBServer';
$db_port = '3306';
$db_user = 'YourUserDB';
$db_pass = 'YourPassword';
$db_name = 'powerdns';
$db_type = 'mysql';
$session_key = 'MasukanSessionKeyYangSudahDiGenearateDiWebBrowser';
$dns_hostmaster = 'YourDNSHostMaster';
$dns_ns1 = 'ns1.localhost.com';
$dns_ns2 = 'ns2.localhost.com';

Ok, Konfigurasi Poweradmin selesai

Jalankan perintah berikut untuk mensupport URL yang digunakan oleh provider DNS dynamic lainnya.

Enable mod_rewrite di Konfigurasi Apache.

# /var/www/html/poweradmin-2.1.7 
# cp install/htaccess.dist .htaccess

Remove “install” folder.

# rm -rf /var/www/html/poweradmin-2.1.7/install/

[9] Sekarang coba buka web browser URL http://YourIPServer/poweradmin-2.1.7/

[-] Menambahkan Master Zones

Ok sekarang check List Zones

[-] Untuk delete DNS Master Zone, Pilih List Zone dan klik icon trash

[10] Untuk reser Password Admin bisa klik ke “Change Password” karena pada saat pertama kali selesai Konfigurasi Admin password kosong login tidak menggunakan password.

OK, Silahkan mencoba..

Cheers – AnditoYugoWicaksono