2015-04-17linux System daily Management 2

Source: Internet
Author: User

Content Summary:
1. Linux Grab Kit
Tcpdump Wireshark
Tcpdump system comes with grab bag tool

Tcpdump-nn

Tshark-nn

[email protected] ~]# tshark-n-t a-r http.request-t fields-e "Frame.time"-E "ip.src"-E "htt P.host "

Tcpdump-nn-i eth0 TCP port 80

Tcpdump-nn-vs0 TCP and Port not 22-c 100-w 1.cap
Wireshark can also install Yum install-y under Linux Wireshark

Packet Capture parsing HTTP request: Tshark-n-T a-r http.request-t fields-e "Frame.time"-E "ip.src"-E "http.host"-E "Http.request.method"-E "Http.request.uri"
2. Selinux
Configuration file/etc/selinux/config Three forms: enforcing, permissive, disabled selinux=disabled
Setenforce 0/1 getenforce Yum install-y libselinux-utils
3. NetFilter--Iptables
Reference: http://www.cnblogs.com/bangerlee/archive/2013/02/27/2935422.html
Reference: http://www.cnblogs.com/bangerlee/archive/2013/02/27/2935422.html
The rule file saved by the service iptables save rule is:/etc/sysconfig/iptables
Service iptables Stop can pause the firewall, but it will read/etc/sysconfig/iptables to start the firewall after the reboot, and even if we stop the firewall, it will open once we add any rule.
Iptables

1. Common commands (-a append rule,-d delete rule,-r modify rule,-I insert rule,-l view rule-f purge rule)
2, commonly used packet ratio parameters: (-P protocol,-s source address,-D destination address 、--Sport Source port 、--dport destination Port,-I enter the network card,-O card)

3, the commonly used processing action: (-j specified to meet the conditions of the package processing, commonly used actions have accept the report, drop discard the report, reject discard the report and notify each other, redirect redirect packet, etc.)
Iptables Rule Related:
View IPTABLES-NVL

Close Iptables-f

Service Iptables Save

4. Linux System Task Scheduler
/etc/crontab Cron master configuration file, you can define path
The cron format is as follows:
#.----------------minutes (0-59)
# | .-------------hours (0-23)
# |  | .----------Day (1-31)
# |  |  | .-------Month (1-12)
# |  |  |  | .----Week (0-6) (Sunday =0 or 7)
# |  |  |  | |
# * * * * * * user-name command to be executed

Time-sharing Week

0 0 2 * *
Cron is also a service, so you need to start the service to be effective: service Crond start; Service Crond Status
Create a scheduled task

Crontab-l

* * * * */usr/local/etc/rc.d/lighttpd restart

0 */8 * * * echo 0 >/tmp/1.log

How to view crontab logging

Less/var/log/cron

http://blog.itpub.net/9252210/viewspace-684597/

Task Schedule Exercises:
Clear/var/log/slow.log This file every 1:20 A.M.
Execute "/bin/sh/usr/local/sbin/backup.sh" every Sunday 3 o'clock
14th # 4:10 per month to execute "/bin/sh/usr/local/sbin/backup_month.sh"
Perform "Ntpdate time.windows.com" every 8 hours
1 points per day, 12 points, 18 points to execute "/bin/sh/usr/local/sbin/test.sh"
"/bin/sh/usr/local/sbin/test2.sh" is executed from 9 to 18 every day.
Extended Data:
1. Tshark several usages: http://www.aminglinux.com/bbs/thread-995-1-1.html
2. Iptables application in a network segment http://www.aminglinux.com/bbs/thread-177-1-1.html
3. Iptables in Sant,dnat,masquerade http://www.aminglinux.com/bbs/thread-7255-1-1.html
4. Iptables implementation of the CentOS intranet access extranet http://www.aminglinux.com/bbs/thread-3624-1-1.html
5. iptables realizes intranet FTP external mapping http://www.aminglinux.com/bbs/thread-1003-1-1.html
6. iptables Limit syn Rate http://www.aminglinux.com/bbs/thread-985-1-1.html
7. SELinux Tutorial Http://os.51cto.com/art/201209/355490.htm
8. SELinux PDF ebook Http://pan.baidu.com/s/1jGGdExK
9. Anacron http://blog.csdn.net/dycwahaha/archive/2007/12/20/1954938.aspx
Video Download:

2015-04-17linux System daily Management 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.