Thứ Sáu, 3 tháng 6, 2011

CORE SYSTEM SERVICE

1. Xinetd
_ A service to manage other services.
_ Packet: xinetd
_ Configure file: /etc/xinetd.conf
_ Folder contains config file: /etc/xinetd.d
_ Script to start xinetd: /etc/rc.d/init.d/xinetd

2. Telnet (xinetd)
_ Disable fw/SE.
_ Edit /etc/xinetd.d/krb5-telnet : row 12 : yes -> no
_ Restart xinetd: #service xinetd restart
_ Save log (edit /etc/xinetd.d/krb5-telnet): log_type = FILE /var/log/telnet.log
_ Prevent other PC to telnet (/etc/xinetd.d/krb5-telnet): no_access =

3. Syslog daemon
_ A service use to store log on system, log on device.
_ Packet: sysklogd
_ Configure file: /etc/syslog.conf
_ Script to start syslog: /etc/rc.d/init.d/syslog
_ Edit syslog.conf: daemon.* /var/log/tientrinh.log
_ Create a fake daemon event: #logger -p daemon.notice "test syslog"

4. Remote syslog
_ VM1(server), VM2(client)

_ Configure server:
+ Edit file /etc/sysconfig/syslog, row 6: SYSLOGD_OPTIONS="-m 0 -r"
+ Add end of file /etc/syslog.conf: *.debug /var/log/messages
+ Restart syslog: #service syslog restart
+ Check port 514/UDP: #netstat -nlup

_ Configure client:
+ Add end of file /etc/syslog.conf: *.debug @192.168.9.118
+ Restart syslog: #service syslog restart

_ Testing:
+ Client: #service network restart
+ Server: #tail -f /var/log/messages

5. Scheduler

_ Example: at 8:30 contain of /boot be saved to file /root/boot.txt
_ Command:
#at 20:30
ls /boot > /root/boot.txt


_ View list scheduler: #atq or #at -l
_ Remove job: #atrm or #at -d
_ Prevent user use at: add end of file /etc/at.deny :

6. Crontab scheduler (loop)

_ Example: backup file /etc/fstab to folder /root at 2h everyday
_ Command:
#crontab -e

1 2 * * * cp /etc/fstab /root

_ View list crontab: #crontab [-u username] -l
_ Remove crontab: #crontab [-u username] -r
_ Crontab folder: /var/spool/cron
_ Crontab log file: /var/log/crontab
_ Prevent user use crontab: edit /etc/cron.deny
_ Template
+ range: 2-6 (every hour from 2 to 6)
+ list: 2,3,5 (at 235)
+ step: */2 (every 2 hours)

0 nhận xét:

Đăng nhận xét

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by netdohoa | Support for this Theme dohoavietnam