This document describes how to use shell on a unix host to monitor host survival and port survival.#! /Bin/bash# Author by fengzhanhai# It used by mon web service and net and host living# It was created on 2012-8-9# Webdate = 'date-d "today" + "% Y-%
A simple command
Command [-option] [parameter]
Command can be an alias, function name, built-in command, external executable program or script
Compound Statement of two shell Control Structure
ForName[InWord]; DoList; Done
For ((Expr1;Expr2;Expr3);
This method is used to passively count the number of IP connections. iptables is used to block IP addresses with a large number of connections. For more information, see iptables to limit the number of ip connections to prevent CC attacks.The Shell
The script content is as follows:
#! /Bin/bash# Process management tool --- htop
Echo "Checking System dependency package installation. Please wait ......"Yuminstallncurses-devel-y
Echo "downloading the htop MAIN package ......"DOWNLOAD
Recently, the server room where the company is located is often unable to access the website due to attacks and network faults. In order to be able to know that the website is inaccessible for the first time and quickly solve the problem, tley uses
Process status variable
1. $ get the current shell process ID (PID)
2. $! PID used to execute the previous command
3. $? Obtain the return value for executing the previous command (0 indicates success, and non-zero indicates failure, which is
I wrote a script that can generate random passwords. If you want to generate only numbers or only letters or upper-case passwords, you can customize them. I have written all the elements here.
#! /Bin/bash # author: honway. liu # date: 2013-07-19 #
Loop Control-for Loop
Syntax 1
For Variable in List
Do
Commands
Done
Syntax structure 2
For Variable in List; do
Commands
Done
This List can be a List, variable, command, etc.
A for Loop provides an element list in advance, and then uses variables
When running a job in Linux, you often encounter the following situations: a large number of jobs need to be run, and the time required to complete each job is not very long. if we run these jobs in serial mode, it may take a long time. If we run
Recently, scripts always need to be computed. It will be troublesome to use awk each time. It encapsulates the addition, subtraction, multiplication, division, and source math. sh for each call.
Some key points should be pointed out to avoid
This article describes the most common tools for using Shell to process text in Linux:Find, grep, xargs, sort, uniq, tr, cut, paste, wc, sed, awk;The examples and parameters provided are the most common and practical;The principle I use for shell
Test the network connection status based on the running status of the daemon. This is far better than simply finding the network connection status parameters. The following uses a script to test the status of a specified process name and displays
1. Linux forgets the root password and enters the single-user mode to change the password
(1) about lilo
1. When lilo appears: Enter Linux single
Lilo: Linux single
2. Press enter to directly access the Linux Command Line
3. Use the password command
(1) Disable finding PHP Functions1disable_functions =
This option can be used to set which PHP functions are not allowed to be used. Some functions in PHP are highly risky. You can directly execute some CentOS system-level script commands. If these
When Centos is installed without a specified partition by default, the logical volume does not have an independent/tmp, which may cause security risks./dev/shm is also one of the risks.
# Dd A 1 GB file, file/. tmpfs
Ddif =/dev/zeroof =/. tmpfsbs
You can use commands to view IP addresses that are too high for web connections, but you need to use AI to seal them. This is too troublesome. You can directly write a script to automatically resolve this issue. The web server uses nginx and python
This article describes how to modify the default sshd settings to ensure sshd security and restriction, and protect your server from hacker intrusion. Every time you change the sshd configuration file, You Need To Restart sshd. In this way, your
Whether you are an ordinary Linux Desktop user or a system administrator managing multiple servers, you are faced with the same problem: an increasing number of threats. Linux is an open system that allows you to find many ready-made programs and
A few days ago, some people used putty and winscp, which had backdoors for promotion and promotion by Baidu. The password was simple and port 22 was cracked by brute force, or the security crisis caused by social engineering passwords, ssh security
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.