1. Skip to Menu
  2. Skip to Content
  3. Skip to Footer>

Thin Client Server

Thin Client Server

Linux Authentication

Linux Authentication

Linux Internet Gateway

Centralized Log Server

Written by Mr. Sontaya Photibut Saturday, 02 May 2009 14:56

การติดตั้ง Centralized Log Server บน Linux SUSE Enterprise Server 10 SP2.

# Centralize Log Server IP Address : 192.168.1.13

แก้ไขโปรแกรม syslog เพื่อให้รับ Message จากเครื่องอื่นๆ

$ vim /etc/sysconfig/syslog
SYSLOGD_PARAMS="" แก้ไขเป็น SYSLOGD_PARAMS="-r -m 0"
-r , -m เพื่ออนุญาตใหรับ Message จากเครื่องอื่นๆ
:wq! (บันทึก)

Configuration Firewall
$ vi /etc/sysconfig/scripts/SuSEfirewall2-custom
ให้เพิ่มบรรทัดข้างล่างในส่วนของ fw_custom_before_antispoofing()
#incoming syslog clients
 iptables -t filter -A INPUT -p udp -s 192.168.0.2 --dport 514 -j ACCEPT
 iptables -t filter -A INPUT -p udp -s 192.168.1.10 --dport 514 -j ACCEPT
 iptables -t filter -A INPUT -p udp -s 192.168.11.2 --dport 514 -j ACCEPT
 iptables -t filter -A INPUT -p udp -s 192.168.11.200 --dport 514 -j ACCEPT
:wq! (บันทึก)

$ vi /etc/sysconfig/SuSEfirewall2
FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom" <-uncomment
#FW_CUSTOMRULES="" <-comment
:wq! (บันทึก)
$ rcSuSEfirewall2 restart


Configuration syslog-ng
$ vim /etc/syslog/syslog-ng.conf
#
# Global options.
#
#options { long_hostnames(off); sync(0); perm(0640); stats(3600); };
options {
   sync (0);
   time_reopen (10);
   log_fifo_size (1000);
   long_hostnames (off);
   use_dns (no);
<-ให้ resolve ค่า IP address ในข้อมูลล็อก เป็น hostname (default = yes)
   use_fqdn (no);
<-บันทึก full name ของเครื่องที่ส่ง tcp/udp message (default = no)
   create_dirs (no);
<-เป็นตัวบอกว่าจะให้ syslog-ng สร้างไดเรกทอรีใหม่ได้หรือไม่ ในกรณีที่ path ที่ระบุไม่มีอยู่จริงในระบบ (default = no)
   keep_hostname (yes);
<-ให้เชื่อใจ (trust) ค่า hostname ที่อยู่ใน tcp/udp message (default = no)
};
source src {
        #
        internal(); 
<-ล็อกที่รับมาจาก syslog-ng daemon
        #pipe("/proc/kmsg");
<-ล็อกที่รับมาจาก name pipe
        unix-dgram("/dev/log");
<-ล็อกที่รับมาจาก Unix socket ที่อยู่ในโหมด connectionless datagram เช่น ล็อกของ klogd จาก /dev/log
        #file("/proc/kmsg" log_prefix("kernel:"));
<-ล็อกที่อ่านมาจากไฟล์ที่ระบุไว้ เช่น /proc/kmsg
        unix-dgram("/var/lib/dhcp/dev/log");
        unix-dgram("/var/lib/named/dev/log");
};



## สำหรับค่าที่ใช้งาน  ให้เพิ่มในส่วนของ options ##
options {
   sync (0);
   time_reopen (10);
   log_fifo_size (1000);
   long_hostnames (off);
   use_dns (no);
   use_fqdn (no);
   create_dirs (no);
   keep_hostname (yes);
   log_msg_size (4096);
};
##-----------------------------------------------------#
#Source from remote client
source s_client {
          udp(ip("0.0.0.0") port(514));
        };
##-----------------------------------------------------#
# Filter Log Squid (Proxy) from clients:
#
filter f_squid { program("squid"); };
destination d_squid {
 file("/var/log/$HOST/$YEAR/$MONTH/squid_access.log"
 owner(root) group(root) perm(0600)
 create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_squid); destination(d_squid); };

##-----------------------------------------------------#
# Filter Log ssh from clients:
#
filter f_ssh { program("sshd") and facility(auth, authpriv); };
destination d_ssh {
  file("/var/log/$HOST/$YEAR/$MONTH/ssh_access.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_ssh); destination(d_ssh); };

##-----------------------------------------------------#
# Filter Log Firewall (iptables) from clients:
#
destination d_firewall {
  file("/var/log/$HOST/$YEAR/$MONTH/firewall"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};

log { source(s_client); filter(f_iptables); destination(d_firewall); };

##-----------------------------------------------------#
# Log apache2 (httpd) web server:
#
filter f_apache { program("apache")or match ("logger:");};
destination d_apache {
file("/var/log/$HOST/$YEAR/$MONTH/apache_access.log"
owner(root) group(root) perm(0640)
create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_apache); destination(d_apache); };




##------------------------------------------------------#
# Log pop3 from mail_server Server:
#
filter f_pop3 { match("vpopmail_server|pop3"); };
destination d_pop3 {
  file("/var/log/$HOST/$YEAR/$MONTH/pop3.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_pop3); destination(d_pop3); };

##-------------------------------------------------------#
# Log IMAP from mail_server Server:
#
filter f_imap { match("imap"); };
destination d_imap {
  file("/var/log/$HOST/$YEAR/$MONTH/imap.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_imap); destination(d_imap); };

##---------------------------------------------------------#
# Log SMTP or Sendmail_server from mail_server Server:
#
filter f_smtp { match("qmail_server-scanner"); };
destination d_smtp {
  file("/var/log/$HOST/$YEAR/$MONTH/smtp.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(s_client); filter(f_smtp); destination(d_smtp); };
:wq (บันทึก)
Note: MTA is Qmail_server.
- vpopmain คือ Package สำหรับทำ Multiple domain name.
-Courier-imap คือ IMAP จาก Courier mail_server server บริการ POP3, POP3-SSL, IMAP และ IMAP-SSL
-qmail_serveradmin คือ Web-based สำหรับผู้ดูแลระบบ (administrator) ที่สามารถเข้าถึง mail_serverboxes, autoresponders, และ mail_serverling lists ภายใต้ domain นั้นๆ.
-vqadmin คือ Web-based สำหรับจัดการ สร้าง, แก้ไข, ลบ, อีเมล์บนโดเมน.
-ucspi-ss คือ โปรแกรมเปิดบริการ socket SSL. 

$ SuSEconfig --module syslog-ng
$ rcsyslog restart
$ syslog-ng  <-ถ้าไม่ขึ้น error ก็ผ่านครับ.
หรือ
$ syslog-ng -d <- ดู debug

Configuration Apache2 (เครื่องเครื่อง mail_server server.)
$ vi /etc/apache2/httpd.conf
ErrorLog /var/log/apache2/error_log
ErrorLog syslog
LogLevel notice
CustomLog "|/bin/logger -p local1.info" combined
:wq! (บันทึก)
$ rcapache2 reload

Ref : http://www.devshed.com/c/a/Apache/Logging-in-Apache/4/

ตรวจสอบ Log ว่ามี client ติดต่อเข้ามายัง.
$ tail -f /var/log/messages
syslog-ng[5236]: AF_INET client connected from 192.16 8.1.11
แสดงว่ามีการติดต่อเข้ามาแล้ว.



สร้างไฟล์สำหรับ rotateใน  /etc/logrotate.d/
$ vi /etc/logrotate.d/logserver
#Rotate 90
/var/log/mail_server/*/*/squid_access.log
/var/log/mail_server/*/*/ssh_access.log
/var/log/mail_server/*/*/firewall.log
/var/log/mail_server/*/*/apache_access.log
/var/log/pattayapdc/*/*/squid_access.log
/var/log/pattayapdc/*/*/ssh_access.log
/var/log/pattayapdc/*/*/firewall.log
/var/log/pattayapdc/*/*/apache_access.log
/var/log/koratpdc/*/*/squid_access.log
/var/log/koratpdc/*/*/ssh_access.log
/var/log/koratpdc/*/*/firewall.log
/var/log/chaingmaipdc/*/*/squid_access.log
/var/log/chaingmaipdc/*/*/ssh_access.log
/var/log/chaingmaipdc/*/*/firewall.log
{
    compress
    dateext
    maxage 365
    rotate 90
    missingok
    notifempty
    size +4096k
    create 640 root root
    postrotate
        /etc/init.d/syslog reload
    endscript
}
:wq! (บันทึก)


ตั้งเวลาให้ทำการ ratate ด้วย crontab.

$ crontab -e
# logserver
59 23 * * * /usr/sbin/logrotate -f /etc/logrotate.d/logserver > /dev/null

สั่ง Logrotate ทําการ Reload เฉพาะ Configuration File (ถ้าต้องการทดสอบ)
$ logrotate -f /etc/logrotate.d/logserver

สร้าง Script ดู Log. (ในกรณีที่ไม่ได้ติดตั้ง mullitaill)
ตัวอย่าง : Script สำหรับดู log proxy (squid)
$ vi /logsquid-koratpdc
#!/bin/sh
ylog=$(date +%Y)
mlog=$(date +%m)
curelog=squid_access.log
hostlog=pattayapdc
tail -f /var/log/$hostlog/$ylog/$mlog/$curelog
$ chmod 700 /logsquid-koratpdc

รันคำสั่งสำหรับดู Log.
$ /logsquid-koratpdc

เข้ารหัสไฟล์ (Encryption Log files and md5sum):
สร้าง Directory สำหรับเก็บ Encrypt Logs
$ mkdir /var/log/backup
$ cd /var/log/backup
สร้าง Scripts Encryption
$ vi encrypt.sh
#!/bin/sh
## Script encryption log files. ##
mkdir $(date +%F)
cd $(date +%F)
pass="1234"
server1=mail_serverserver
server2=koratpdc
server3=chaingmaipdc
server4=pattayapdc
# Path files.
log_path1=/var/log/mail_server
log_path2=/var/log/koratpdc
log_path3=/var/log/chaingmaipdc
log_path4=/var/log/pattayapdc
# Create archive.
tar zcvf $server1.tar.gz $log_path1
tar zcvf $server2.tar.gz $log_path2
tar zcvf $server3.tar.gz $log_path3
tar zcvf $server4.tar.gz $log_path4
# Encryption files.
openssl des -in "$server1".tar.gz -k "$pass" -out "$server1".tar.gz.sec
openssl des -in "$server2".tar.gz -k "$pass" -out "$server2".tar.gz.sec
openssl des -in "$server3".tar.gz -k "$pass" -out "$server3".tar.gz.sec
openssl des -in "$server4".tar.gz -k "$pass" -out "$server4".tar.gz.sec
# Check sum.
md5sum "$server1".tar.gz.sec > MD5SUM-$server1
md5sum "$server2".tar.gz.sec > MD5SUM-$server2
md5sum "$server3".tar.gz.sec > MD5SUM-$server3
md5sum "$server4".tar.gz.sec > MD5SUM-$server4
# Delete archive.
rm *.tar.gz
echo "encrypt finish. "

:wq! (บันทึก)
$ chmod 700 encrypt.sh


ถอดรหัสไฟล์ (Decryption Log files):
$ vi decrypt.sh
#!/bin/sh
## Script encryption log files. ##
mkdir $(date +%F)
cd $(date +%F)
pass="1234"
server1=mail_serverserver
server2=koratpdc
server3=chaingmaipdc
server4=pattayapdc
# Decryption files.
openssl des -d -in "$server1".tar.gz.sec -k "$pass" -out "$server1".tar.gz
openssl des -d -in "$server2".tar.gz.sec -k "$pass" -out "$server2".tar.gz
openssl des -d -in "$server3".tar.gz.sec -k "$pass" -out "$server3".tar.gz
openssl des -d -in "$server4".tar.gz.sec -k "$pass" -out "$server4".tar.gz
# Check SUM.
md5sum -c MD5SUM-$server1 >> OUTPUT_MD5
md5sum -c MD5SUM-$server2 >> OUTPUT_MD5
md5sum -c MD5SUM-$server3 >> OUTPUT_MD5
md5sum -c MD5SUM-$server4 >> OUTPUT_MD5
# Extact files
tar zxvf $server1.tar.gz
tar zxvf $server2.tar.gz
tar zxvf $server3.tar.gz
tar zxvf $server4.tar.gz
# Delete archive.
rm *.tar.gz
echo "decrypt finish. "

:wq! (บันทึก)
$ chmod 700 decrypt.sh

ตรวจสอบ Log ไฟล์ว่ามีการแก้ใขหรือไม่ (Check sum):
$ cat OUTPUT_MD5
# ถ้า Log files อยู่ในสภาพเดิม :
pattayapdc.tar.gz.sec: OK

# ถ้า Log files มีการแก้ไข :
pattayapdc.tar.gz.sec: no properly formatted MD5 checksum lines found.
ตั้งเวลาให้ Scripts ทำงาน
#encryption log
0 0 * * 0 /var/log/backup/encrypt.sh 2>&1 > /dev/null

ติดตั้งโปรแกรมเพื่อดู Log ไฟล์ (Log  Monitoring by multitail):
$ wget http://www.vanheusden.com/multitail/multitail-5.2.2.tgz
$ tar xvf multitail-5.2.2.tgz
$ cd multitail-5.2.2
$ make install
$ make thanks

ตัวอย่างการใช้คำสั่ง
Show 5 logfiles while merging 2 and put them in 2 columns with only one in the left column:
$ multitail -s 2 -sn 1,3 /var/log/mail_server/2008/09/apache_access.log -I /var/log/mail_server/2008/09/pop3.log /var/log/pattayapdc/2008/09/squid_access.log /var/log/koratpdc/2008/09/squid_access.log /var/log/squid/access.log

Show 3 logfiles in 2 columns:
$ multitail -s 2  /var/log/mail_server/2008/09/smtp.log  /var/log/mail_server/2008/09/imap.log /var/log/mail_server/2008/09/pop3.log


แก้ไขให้เมล์ที่ส่งภายใน โดเมน (local to local) ให้เข้าqmail_server-scanner (Changing Your Tcp Rules):
$ /etc/tcprules.d/tcp.smtp
# adding the Qmail_serverQUEUE variables to 127.
127.:allow,RELAYCLIENT="",Qmail_serverQUEUE="/var/qmail_server/bin/qmail_server-scanner-queue.pl"
192.168.1.1:allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="50",
CHKUSER_WRONGRCPTLIMIT="10",Qmail_serverQUEUE="/var/qmail_server/bin/qmail_server-scanner-queue.pl"

192.168.:allow,RELAYCLIENT="",Qmail_serverQUEUE="/var/qmail_server/bin/qmail_server-scanner-queue.pl"
:allow,BADMIMETYPE="",BADLOADERTYPE="M",CHKUSER_RCPTLIMIT="50",
CHKUSER_WRONGRCPTLIMIT="10",Qmail_serverQUEUE="/var/qmail_server/bin/qmail_server-scanner-queue.pl"

:wq! (บันทึก)

Rebuild cdb file:
$ qmail_serverctl cdb
Restart Qmail_server Server:
$ qmail_serverctl restart

ตรวจสอบ log (qmail_server-scanner): ที่เครื่อง Centralized Log Server
$ tail -f /var/log/mail_server


สำหรับ Client

Firewall Setting:
$ vi /etc/sysconfig/SuSEfirewall2
FW_CUSTOMRULES="/etc/sysconfig/scripts/SuSEfirewall2-custom" <-uncomment
#FW_CUSTOMRULES="" <-comment
:wq! (บันทึก)

$ rcSuSEfirewall2 restart
$ vi /etc/sysconfig/scripts/SuSEfirewall2-custom
#example: allow incoming multicast packets for any routing protocol
#iptables -A INPUT -j ACCEPT -d 224.0.0.0/24
#Syslog-ng
    iptables -t filter -A OUTPUT -p udp -s 192.168.1.13 --dport 514 -j ACCEPT

   true
}
:wq! (บันทึก)

Update Squid 2.5 to 2.6 (Version 2.5 ไม่สนับสนุน syslog)
$ rcsquid stop
$ rpm -Uvh squid-2.6.STABLE5-31.1.i586.rpm
 (created as /etc/squid/squid.conf.rpmnew)
 (rpm -Fvh ) -F : upgrade package(s) if already installed

$ vim /etc/squid/squid.conf
# comments
    #httpd_accel_host virtual
    #httpd_accel_port 80
    #httpd_accel_with_proxy on
    #httpd_accel_uses_host_header on



http_port 3128 transparent
##Additional line for Log Server
access_log syslog squid
access_log /var/log/squid/access.log squid

cache_dir ufs /var/cache/squid 2000 16 256
access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

:wq! (บันทึก)
$ rcsquid start

Config syslog-ng (Version 1.6.8)
$ vim /etc/syslog-ng/syslog-ng.conf
#options { long_hostnames(off); sync(0); perm(0640); stats(3600); };
options {
   sync (0);
   time_reopen (10);
   log_fifo_size (1000);
   long_hostnames (off);
   use_dns (no);
   use_fqdn (no);
   create_dirs (no);
   keep_hostname (yes);
};
source src {
        internal();
        unix-dgram("/dev/log");
        unix-dgram("/var/lib/dhcp/dev/log"); # for dhcp server, if you run service dhcp.
        unix-dgram("/var/lib/named/dev/log");
};
ให้พิมพ์เพิ่ม ต่อจากบรรทัดสุดท้าย
## LogServer additional by Sontaya Photibut ##
destination logserver {udp("192.168.1.13" port(514));};

#
# Squid log to Centralized Log Server:
#
filter f_squid { program("squid"); };
destination d_squid {
 file("/var/log/$HOST/$YEAR/$MONTH/squid.$YEAR-$MONTH-$DAY"
 owner(root) group(root) perm(0600)
 create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_squid); destination(logserver); };

#
# SSH log to Centralized Log Server:
#
filter f_ssh { program("sshd") and facility(auth, authpriv); };
destination d_ssh {
  file("/var/log/$HOST/$YEAR/$MONTH/ssh.$YEAR-$MONTH-$DAY"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_ssh); destination(logserver); };

#
# Firewall (iptables) log to Centralized Log Server:
#
destination d_firewall {
  file("/var/log/$HOST/$YEAR/$MONTH/firewall.$YEAR-$MONTH-$DAY"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_iptables); destination(logserver); };

#
# Apache2 (httpd) log to Centralized Log Server:
#
filter f_apache { program("apache") or match ("logger:"); };
destination d_apache {
file("/var/log/$HOST/$YEAR/$MONTH/apache.$YEAR-$MONTH-$DAY"
owner(root) group(root) perm(0600)
create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_apache); destination(logserver); };

#
# POP3  Log Service.
#
filter f_pop3 { match("vpopmail|pop3"); };
destination d_pop3 {
  file("/var/log/$HOST/$YEAR/$MONTH/pop3.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_pop3); destination(logserver); };
#
# IMAP Log  Service.
#
filter f_imap { match("imap"); };
destination d_imap {
  file("/var/log/$HOST/$YEAR/$MONTH/imap.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_imap); destination(logserver); };
#
# SMTP or Sendmail Log Service.
#
filter f_smtp { match("qmail-scanner"); };
destination d_smtp {
  file("/var/log/$HOST/$YEAR/$MONTH/smtp.log"
  owner(root) group(root) perm(0600)
  create_dirs(yes) dir_perm(0700));
};
log { source(src); filter(f_smtp); destination(logserver); };

:wq (บันทึก)

$ SuSEconfig --module syslog-ng
$ rcsyslog restart

แก้ไข httpd.conf
$ vi /etc/apache2/httpd.conf
ErrorLog /var/log/apache2/error_log
## Add line for syslog-ng
ErrorLog syslog
LogLevel notice
CustomLog "|/bin/logger -p local1.info" combined

:wq! (บันทึก)
$ rcapache2 restart


 


Comments (0)Add Comment

Write comment

security code
Write the displayed characters


busy
 

SUSE Linux Enterprise Cool Solutions

  • One-Click ConsoleOne via SSH

    One-Click Access to ConsoleOne in Linux

    Running ConsoleOne directly from the server is helpful and often necessary, especially if you are using SLES as the server OS. With OES, you have the NSS file system that lets you easily connect a Windows workstation to your domain (assuming that workstation has a Novell Client). If you're using a Linux desktop that is capable of running the Novell Client for Linux, ConsoleOne can still be run locally while connecting to the domain database on the OES server. Using a SLES server further limits your options.

    Instead of installing and configuring Samba or NFS (which I'm not sure is recommended anyway), using SSH to run ConsoleOne allows you to use a common protocol.

    I most often use the Linux desktop and have been able to make one-click ConsoleOne access via SSH work. While Putty, a Windows SSH client, can provide similar functionality, I do not know of a way to generate the necessary SSH key with Putty in order to make this work in a one-click way.

    For the remainder of this article, I'll call the server running the domain and from where we want to run ConsoleOne 'gwdom1'. I will assume that ConsoleOne with the current snapins is installed, executable, and fully functional from the domain server console for the purposes of administering GroupWise. I will also assume that we want to connect to this server as 'root'.

    Running ConsoleOne via SSH

    This is the easy part. First, SSH to the server where the domain is running as the root user using the following command. The '-X' is crucial as it enables X11 forwarding:

    ssh -X root@gwdom1
    

    After entering the root password, execute this command:

    /usr/ConsoleOne/bin/ConsoleOne
    

    At this point, ConsoleOne should appear on your Linux desktop (running from gwdom1) and you can login and connect to gwdom1's domain database. This will verify that ConsoleOne can be run in the way it needs for this process to ultimately work.

    This part should be possible using Putty for Windows. However, providing the specific steps of doing so is not the intent of this article.

    Your Very Own Script

    You can easily combine the above two commands into one script file. First, go to your home folder using the console and switch to a folder called /bin. For non-root users, it will be /home/username/. For root, it's /root.

    Once in the /bin folder of your home folder, create a file called 'c1_gwdom1' (or whatever you want to use as the command that calls this) using your favorite text editor. The file should contain the following:

    #/bin/bash 
    
    ssh -X root@gwdom1 "/usr/ConsoleOne/bin/ConsoleOne &"
    
    

    The '#/bin/bash' part is probably unnecessary, but I've gotten in the habit of putting this in my scripts. Nevertheless, save the file and exit your editor. Now, from the console, make your script executable. Use the command:

    chmod 755 c1_gwdom1
    

    Because your /bin folder in your home folder is, by default, in the path, you should be able to type 'c1_gwdom1' from any folder and it will start. Try it out. You will have to enter the root password for gwdom1 to have it connect (more on removing this later). ConsoleOne should start on your local workstation. If you want to have it start in the background, use 'c1_gwdom1 &' and you won't have to keep your console window open.

    No Password Required

    Here it gets more complicated. However, this is also the key to one-click access. This is also the part that I am unsure how to duplicate in Windows. It may be there, but my limited use of Windows for administration of GroupWise has kept me from researching this further.

    What we have to do is to first generate an SSH key, then enter the key info into gwdom1's authorized list. This tells gwdom1 to trust connections from this machine. So keep in mind that if you have multiple machines from which you want to use one-click ConsoleOne, you will have to repeat this step for each.

    From a console on your Linux desktop, enter 'ssh-keygen -t rsa' and you should get a prompt for a path. Use the default path and leave the passphrase blank. Once you've finished that command, you should have a file in your Linux desktop's /home/username/.ssh/ folder called 'id_rsa.pub'. View the contents of this file by typing:

    cat /home/username/.ssh/id_rsa.pub
    

    Highlight and copy the contents of that file to the clipboard using the GUI. Now open another console and SSH over to gwdom1 as root.

    In the /root/.ssh/ folder of gwdom1 you should find a file called authorized_keys2. Make a quick backup copy of this file before you start editing it. Edit the file and go the bottom. Add another line, then Paste the contents of your local id_rsa.pub file into it. Save the file and exit out of the SSH session.

    Test this by re-SSHing to gwdom1. If it worked, then you should be able to SSH without getting a password prompt.

    Click Me!

    To make it all nice, neat, and easily accessible you can now create yourself a shortcut. The steps for doing this will depend on whether you use GNOME or KDE (or another Desktop Environment). Chances are that you know how to do this so I will not go into specific steps to create a shortcut.

    The application/command that you want the shortcut to run is:

    /home/username/bin/c1_gwdom1 &
    

    Create it and click to test.

    What should happen is that ConsoleOne should now appear, having been run over SSH from the server running/hosting your domain.

  • SLES 11 and High Availability Extension (HAE) with DLM, O2CB and SSH stonith

    In this scenario I will be setting up Novell High Availability Extension (HAE) on SLES 11. I will also demonstrate how to setup dlm, o2cb and SSH stonith.

    Some items that I have pre-configured are as follows.

    1. 1 SMT server
    2. 3 server installed with SLES 11 and HAE as a add-on product.

      Please see the following link:
      http://www.novell.com/documentation/sle_ha/book_sleha/data/part_install.html

    3. Each SLES 11 HAE server is fully patched with the latest code from my SMT server(2/24/10)
    4. Networking is setup as demonstrated in the following picture.

    Assumptions:

    In this document I assume the reader has some basic knowledge of quorm, fencing, and resource attributes. That said I will show each step with a screen shot during resource configuration. Although this document could be adopted into a production environment; I assume that this document will only be used in a test environment and for learning purposes only.

    Warning:

    During resource configuration I setup a ssh-stonith resource. As noted in the documentation this resource should not be used in production. Please also note that Novell will not support the resource except in a test situation where a real stonith resource, such as ilo, DRAC card, external power supply or other such stonith resource is not available.

    DRAC card:

    ilo card:

    Setup of the previous environment:

    Edit the /etc/hosts and put entries into the hosts file for each node.

    Create a ssh-key for every node.

    For example:

    #:~> ssh-keygen 
    Generating public/private rsa key pair. 
    Enter file in which to save the key (/root/.ssh/id_rsa): 
    /root/.ssh/id_rsa already exists. 
    Overwrite (y/n)? y 
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /root/.ssh/id_rsa. 
    Your public key has been saved in /root/.ssh/id_rsa.pub. 
    The key fingerprint is: 
    9e:92:9c:01:9e:fd:fb:12:73:7d:a7:cc:e1:11:ad:7f root@hae1 
    The key's randomart image is: 
    +--[ RSA 2048]----+ 
    |                 | 
    |                 | 
    |    .          . | 
    |   . +        . .| 
    |    o o S  .   o | 
    |     . *o.. . = .| 
    |      = ++   = * | 
    |       ...    = E| 
    |        .o.     .| 
    +-----------------+ 
    
    

    Now copy that key to every node. You will need to repeat this process on each node so that all nodes trust each other.

    Example:

    #:~$ cd .ssh/
    #:~/.ssh$ ls
    authorized_keys  id_rsa  id_rsa.keystore  id_rsa.pub  id_work  known_hosts
    #:~/.ssh$
    
    #: scp id_rsa.pub root@hae2:/root/.ssh/id.rsa.hae1.pub
    
    

    Now go to HAE2 and type the following:

    HAE2 /root/home/.ssh/: cat id.rsa.hae1.pub >> authorized_keys
    
    

    Repeat this for each node. When you are finished you should be able to ssh to any node from any node without entering a password or pass-phrase.

    I will be following these instructions from the HAE documentation:
    http://www.novell.com/documentation/sle_ha/book_sleha/data/cha_ha_installation_yast.html

    1. Open yast > cluster and configure it as the following:

      Communication Channels

      Note: Each node will have its own Node ID: For HAE1 – 1, HAE2 - it will be 2 and HAE3 - 3

      Security

      Note: When you enable security you add protection to the cluster. When you generate the Authentication file you will need to copy it over to each node in the cluster.

      Service

    2. Copy the /etc/ais/authkey and /etc/ais/openais.conf to the other nodes in the server.

      For example:

      #: scp /etc/ais/openais.conf  root@HAE2:/etc/ais/openais.conf
      #: scp /etc/ais/openais.conf  root@HAE2:/etc/ais/openais.conf
      
      

      Note: Do this for each node.

      !Remember: Make sure to edit the openais.conf and match up the node id for the node you are on. For example. HAE1 will be 1 and HAE2 will be 2 and HAE3 will be 3. You can also do this via yast > cluster.

      Your cluster can now be started.

      #: rcopenais start
      
      

      Before you login to the cluster you will need to set hacluster's password on each node.

      #: passwd hacluster
      enter new password:
      
      

      Now you are set to login.

      #: crm_gui

    Creating a dlm resource:

    Under Resources click Add and choose Clone and then Ok.

    Once you have passed through to this point you will want to click "ok, ok, apply or ok". You will now have a dlm resource. We will now configure o2cb and then a stonith resource before starting dlm.

    configuring O2CB:

    Configuring ssh:

    Configuring resource order:

    Once you are all done you can apply the changes. You will now want to start you resources starting with your ssh-stonith then dlm and finally O2CB.

    Final results:

  • REMUS: XEN high availability easy!

    Have you heard about the REMUS project? It's a fantastic piece of code maintaining an exact copy of your XEN virtual machines on a backup host.

    Better yet: it's now incorporated into the XEN hypervisor and expected in the next major release!

    "The Remus project has just been incorporated into the Xen hypervisor. Developed at the University of British Columbia, Remus provides a thin layer that continuously replicates a running virtual machine onto a second physical host. Remus requires no modifications to the OS or applications within the protected VM: on failure, Remus activates the replica on the second host, and the VM simply picks up where the original system died. Open TCP connections remain intact, and applications continue to run unaware of the failure. It's pretty fun to yank the plug out on your web server and see everything continue to tick along. This sort of HA has traditionally required either really expensive hardware, or very complex and invasive modifications to applications and OSes."

    http://dsg.cs.ubc.ca/remus

  • Take a Trip Down Memory Lane - 10 Year Anniversary Timeline for SUSE Linux Enterprise Server for System z

    From the moment we introduced SUSE Linux Enterprise Server for the mainframe more than ten years ago, our commitment to helping you optimize on IBM System z has never wavered. Together, with our valued partner IBM, we’ve developed more Linux-for-mainframe innovations than any other provider, delivering the simplest, most cost-effective alternative server consolidation platform to x86 platforms available today. So, as the only distributor that’s been delivering an enterprise-class and fully supported Linux operating system since the very start of Linux on the mainframe, we can safely say that if history often repeats itself, the future looks even brighter.

    View the timeline today at: http://bit.ly/a8dW44<

  • Ten Years On the Mainframe!

    Mainframes are about 40 years old. And as you probably know, several years ago mainframes were written off as expensive, dated computers that were capable of running only large business applications. Mainframe go south, many said. Not anymore - thanks to Linux!

    Linux on mainframes has evolved rapidly during the past 10 years - yes - 2010 is the 10th anniversary of Linux on the mainframe. The more, there has been shifting of dynamics with the System z10. IBM has done an excellent job with the price/performance ratio, and many companies that have gone through a cost per transaction analysis have determined that the z10 can process their transactions at half the cost of a distributed environment. And the new IBM System z Solution Edition for Enterprise Linux and the Enterprise Linux Server is an additional catalyst for bringing new workloads to Linux on the mainframe.

    Today, in general we see many companies taking a critical look at their existing and new workloads, and asking hard business questions to determine the best platform. These companies are recognizing they need outstanding RAS to manage their mission-critical workloads, and the mainframe uniquely fulfills this business requirement. And these companies are realizing that investing in a first move turns back in consequence - even more if they run Linux on their mainframes.

    SUSE Linux Enterprise Server for System z has been available since the very start of Linux on the mainframe - yes - 2010 it has its 10th anniversary, too. If you want to hear from happy customers running SUSE Linux Enterprise Server for System z on their mainframes why and how they do so, and learn more from our experts, you should consider to drop over at one of the upcoming conferences for System z.

    SHARE in Seattle
    March 14-18 2010, Washington State Convention and Trade Center, Washington

    Recommended sessions:

    • Linux System Management for the Mainframe System Programmer - Part 1&2 (Mark Post, Novell), Mar 15 1:30-4:00 PM Room 608
    • Using Logical Volume Manager (LVM) to Reduce the Hassle Managing Disk Space on Linux (Mark Post, Novell), Tue Mar 16 9:30-10:30 AM Room 609
    • Linux Installation Planning (Mark Post, Novell), Mar 16 3:00-4:00 PM, Room 609
    • What's New with SLES 11 on System z (Mark Post, Novell), Mar 18 9:30-10:30AM, Room 609
    • Linux on System z at Wells Fargo: Penguins Board the Stagecoach (Marcy Cortes, Wells Fargo Bank), Mar 17 1:30-2:30 PM, Room 611
    • Success with Linux on System z at Nationwide - Lessons Learned (Jim Vincent, Nationwide Insurance), Mar 17 3:00-4:00PM, Room 611
    • Linux Servers on System z: Benefits and Features of Virtualization in the Enterprise Data Center (Rick Barlow, Nationwide Insurance), Mar 17 4:30-5:30PM, Room 611

    For more information, see
    http://www.share.org/Events/UpcomingConference/tabid/349/Default.aspx<

    Novell BrainShare Salt Lake City
    March 22-25 2010, Salt Palace Convention Center in Salt Lake City, Utah

    • ELS208 German Pension Fund Goes Linux: Legacy Application Migration to z/Linux with Minimal Risk (Falk-Oliver Bischoff, German Pension Fund/Florian Delonge, Clerity/Olaf Senger, IBM), Mar 22 11:30AM, Room 150 D/E
    • ELS206 Hands-on Workshop: Install SUSE Linux Enterprise Server on IBM System z (Richard Lewis, IBM), Mar 23 9AM-1PM and Mar 25 9AM-1PM, Room 255B
    • ELS310 What's New with Linux on System z (Richard Lewis, IBM/Ihno Krumreich, Novell), Mar 24, Room 251 F

    For more information, see: http://www.novell.com/brainshare/<

    WAVV - World Alliance of VSE VM Linux
    April 9-13, 2010 Covington, Kentucky, Embassy Suites Cincinnati - River Center

    • Linux Installation Planning (Mark Post, Novell), Apr 10 3:00PM
    • Using Logical Volume Manager (Mark Post, Novell), Apr 12 11:45AM
    • What’s new with SLES 11 on System z (Mark Post, Novell), Apr 12 4:15PM

    For more information, see: http://www.wavv.org/

Sponsors List