Sponsored by

Thursday, May 1, 2008

Configure SSL on Linux

Do the following:
1. From the terminal window (as root), create the file random byentering the following:
cat /dev/random > /tmp/random
2. Press some keys on the keyboard to generate random events which help tocreate the file.
3. Stop the process after about 15 seconds by pressing Ctrl+C.
4. Generate a server key by entering the following (on one line):
openssl genrsa -des3 -out /tmp/account.key-rand /tmp/random 1024
5. When prompted for a pass phrase, enter linux (twice).
6. Sign the key by entering the following (on one line):
openssl req -new -x509 -key /tmp/account.key-out /tmp/account.crt
7. When prompted for a pass phrase, enter novell; then enter thefollowing information:
8. Copy the files by entering the followingcommands:
cp /tmp/account.key /etc/apache2/ssl.key/cp /tmp/account.crt /etc/apache2/ssl.crt/
9. Delete the temporary files by entering the following:
rm /tmp/account*
10. Adjust the file system permissions by entering the followingcommands:
chmod 400 /etc/apache2/ssl.key/account.key
chmod 400 /etc/apache2/ssl.crt/account.crt
11. Open the file /etc/apache2/vhosts.d/accounting.conf in a text editor, and change the following lines:
www.account.com to
www.account.com:443 > and
ServerName www.account.com:80 to ServerName www.account.com:443
12. Add the following lines after the ServerName directive:
SSLEngine on
SSLCipherSuiteALL:ADH:EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULLSSL
CertificateFile /etc/apache2/ssl.crt/account.crt
SSLCertificateKeyFile /etc/apache2/ssl.key/account.key
The lines starting with SSLCipherSuite, ALL:, and LOW:should be on one line.
13. Save and close the file.
14. Open the file /etc/sysconfig/apache2 in a text editor, and change the following lines:
APACHE_SERVER_FLAGS=”SSL”
APACHE_START_TIMEOUT=”10”
15. Save and close the file.
16. From the terminal window, check the syntax of the configuration file by entering the following:
apache2ctl configtest
17. Restart Apache by entering the following:
rcapache2 restart
18. When prompted for the pass phrase, enter linux. When prompted for the pass phrase, enter linux.
Configure a Web Application Server.
19. As the pass phrase has to be entered every time the server starts, you can prevent the server from being started automatically at boot by entering the following:
insserv -r apache2
20. From the Firefox browser, enter the following:
https://www.account.com
As the certificate used in this exercises is self-signed, the browser displays a warning.
21. In the warning dialogs, select Continue and Forever to view theweb site.
22. In the login dialog, enter a username of geeko with a password of linux.
23. After the page displays, close the Firefox browser and all other open windows.

Configure Zone Transfers from the Master Server to Slave

You configure zone transfers from a master to aslave server.-Create a 128 bit MD5 key with the name zonetransfer.-Configure the master server to use this key for zonetransfer. Create a file /etc/named.key where you enter the keyzonetransfer options. This file is included into the /etc/named.conf
You configure the slave to server to use this key for zonetransfer. Copy the file /etc/named.key from the master server to theclient server and include it into the file /etc/named.conf.
Do the following:
■ Part I: Generate a Key
■ Part II: Configure the Master Server
■ Part III: Configure the Slave Server
Part I: Generate a Key
1. To stop the DNS server, enter
rcnamed stop
2. Change the directory by entering
cd /var/lib/named
3. To generate a key, enter (on one line)
dnssec-keygen -a HMAC-MD5 -b 128 -n HOST zonetransfer
4. Record the file name of the key in the space below:
Part II: Configure the Master ServerDo the following:
1. Create a new file /etc/named.key with the following content:
key zonetransfer {
algorithm HMAC-MD5;
secret “key”;
};
Instead of key insert the key you created in part I.
2. Change the owner of the file to named by entering
chgrp named /etc/named.key
3. Remove the read permission for others from the file by entering
chmod o-r /etc/named.key
4. On the master server, open the /etc/named.conf file with a texteditor.5. Add the following line at the beginning of the file:
include “/etc/named.key”;
6. Change the content of the zone description of angkor.biz. as follows:
zone "angkor.biz" in {
type master;
file "master/angkor.biz.zone";
allow-transfer {key zonetransfer;};
};
7. Change the content of the zone description of 65.168.192.in-addr.arpa as follows:
zone “65.168.192.in-addr.arpa” in {
type master;
file “master/65.168.192.zone”;
allow-transfer {key zonetransfer;};
};
8. Save the file and exit the text editor.
9. Open a second terminal window and enter su - to get rootpermissions.
10. When prompted, enter the root password .
11. Enter the command
tail -f /var/log/messages
12. Switch to the first terminal window and start bind by entering
rcnamed start
13. From the second terminal window, watch the log output of bindwhen the slave server is started.
Part III: Configure the Slave ServerDo the following:
1. Copy the file /etc/named.key from the master server to the slaveserver.
2. Change the owner of the file to named by enteringchgrp named /etc/named.key
3. Remove the read permission for others from the file by entering
chmod o-r /etc/named.key
4. On the slave server, open the /etc/named.conf file with a texteditor.
Configure the DNS Server Using BIND5.
Add the following line at the beginning of the file:
include “/etc/named.key”;
6. Add the following lines after the option section:
key zonetransfer {
algorithm HMAC-MD5;
secret “key”;
};
server IP_address_of_the_master_server {
keys {zonetransfer;};
};
In the secret option, enter the key of the master server.
7. Save the file and exit the text editor.
8. Remove the files in the directory /var/lib/named/slave/ by entering:
rm /var/lib/named/slave/*
9. Open a second terminal window and enter su - to get root permissions.
10. When prompted, enter the root password novell.11. Enter the command
tail -f /var/log/messages
12. Switch to the first terminal window and start bind by enteringrcnamed start
13. From the second terminal window, watch the log output of bindto see if the zone transfer will be done.

Configure Slave in Linux

To configure Slave DNS in SuSE we consider before we have Primary DNSAnd edit file in /etc/named.conf
# The following zone definitions don't need any modification. The first one
# is the definition of the root name servers. The second one defines
# localhost while the third defines the reverse lookup for localhost.zone "." in {
type hint;
file "root.hint";
};
zone "localhost" in {
type master;
file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.zone";
};
zone "angkor.biz" in {
type slave;
file "slave/angkor.biz.zone";
masters {192.168.65.46; };
};
zone "65.168.192.in-addr.arpa" in {
type slave;
file "slave/65.168.192.zone";
masters {192.168.65.46; };
};
And save it.Don't forget for reserve name edit file in /etc/resolv.conf
search angkor.biz
nameserver 192.168.65.46
And restart service dns by
Omeka#rcnamed restartAnd check
#ll /var/lib/named/slave
Enjoy!

Configure Primary DNS in Linux

Before install DNS in SuSE Linux
install packet bind , bind-chrootenv, bind-utils
Note logon as root to have full permission
after edit file /etc/named.conf
# The following zone definitions don't need any modification.
# The first oneis the definition of the root name servers. The second one defines# localhost while the third defines the reverse lookup for
localhost.zone "." in {
type hint;
file "root.hint";};
zone "localhost" in {
type master;
file "localhost.zone";
};
zone "0.0.127.in-addr.arpa" in {
type master;
file "127.0.0.zone";
};
zone "angkor.biz." in {
type master;
file "master/angkor.biz.zone";
};
zone "65.168.192.in-addr.arpa" in {
type master;
file "master/65.168.192.zone";
};
-And create for Forward Lookup zone angkor.biz.zone in
/var/lib/named/master
$TTL 172800
@ IN SOA sisophon.angkor.biz. Omeka.sisophon.angkor.biz. (
200803022; serial number
1D ; Refresh
2H ; Retry
1W ; Expire
3H ); Minimum
@ IN NS sisophon.angkor.biz.
sisophon IN A 192.168.65.1
Omeka IN A 192.168.65.46
Student IN A 192.168.65.22
Mami IN A 192.168.65.128
www IN CNAME Omeka
-And after create Reverse Lookup Zone 65.168.192.zone in /var/lib/named/master
$TTL 172800

@ IN SOA sisophon.angkor.biz. Omeka.sisophon.angkor.biz. (
20080322 ; Serail Number
1D ; Refresh
2H ; Rretry
1W ; Expire
3H) ; Minimum
65.168.192.in-addr.arpa. IN NS Omeka.sisophon.angkor.biz.
46 IN PTR Omeka.sisophon.angkor.biz.
At the end restart our dns by command
Omeka#rcnamed restart

Twitter Delicious Facebook Digg Stumbleupon Favorites More