1. sync effects: the disk buffer is written to disk, to prevent a sudden power failure. Calling this command shutdown Linux.
2. sysctl See kernel configuration parameters Kernel parameter configuration file /etc/sysctl.conf, sysctl -p The default is to perform /etc/sysctl.conf, you may be followed by the specified configuration file name as an argument.
3. ntsysv Red Hat systems and other types of support, ROOT execution, you can configure boot from the start of service. * Indicates a boot, the spacebar to set the selected or deselected, tab key to switch to confirm, cancel, or selection list. Do not take effect immediately
Use of examples:
chkconfig --list # List all system services
chkconfig --add httpd # service httpd increase
chkconfig --del httpd # delete httpd service
chkconfig --level httpd 2345 on # httpd set in the case of 2,3,4,5 runlevel it is on (open) state
chkconfig --list # lists all system services startup situation
chkconfig --list mysqld # listed mysqld service settings circumstances
chkconfig --level 35 mysqld on # set mysqld in grades 3 and 5 to start running services, - level 35 indicates the operation in grades 3 and 5 perform only, on start showing, off means closed
chkconfig mysqld on # mysqld set in each grade on, "each grade" rating include 2,3,4,5
How to add a service:
1. Service script must be saved under /etc/init.d/ directory name and the same service name.
2.chkconfig --add servicename
This service tool chkconfig increase in the list of services, then the service will be given in /etc/rc.d/rcN.d in K / S the entrance;
3.chkconfig --level 35 servicename on
Modify the default startup service level.
5. Crontab regularly perform certain tasks. System task / etc / crontab, users add their own tasks, create a task description file, then "crontab filename" the task is added to the user's task list, / var / spool / cron under a user file with your name represents the user's Scheduled Tasks.
crontab file meanings:
User created crontab file, each line represents a task, each row represents a field setting, its format is divided into six fields, paragraph five is the time setting section, the sixth paragraph is command section to be executed in the following format
minute hour day month week command
In each of the above fields, you can also use the following special characters:
An asterisk (*): On behalf of all possible values, for example, if the month field is an asterisk, said after meeting the other fields are constraints execute the command operation month.
Comma (,): You can use a comma-separated list of values to specify a range, for example, "1,2,5,7,8,9"
The bar (-): You can use an integer between bar represents a range of integers, such as "2-6" means "2,3,4,5,6"
Forward slash (/): You can use the forward slash specified time interval on the frequency of, for example, "0-23 / 2" performed once every two hours. At the same forward slash and asterisk can be used in conjunction with, for example, * / 10, if used in minute field representing performed once every ten minutes.
For example, 30 12 * / 2 1-8 * / bin / ps -aux >> /tmp/log.txt, 1 August every two days, the recording process of the case 12:30
-n check the routing table
Add to a certain segment of the route route add -net 192.168.1.0/24 gw 192.168.2.1
Add to a host route route add -host 192.168.1.1 gw 192.168.2.1
Add a default route route add default gw 192.168.2.1
Remove route is to replace the above add the line to del
7.setup Red Hat comes with commands to configure the IP DNS
8. openssl RSA encryption and decryption
1. Generate an RSA key, openssl genrsa -out test.key 1024 Description: test.key private key file key length 1024
2. Extract the public key: openssl rsa -in -test.key -pubout -out test_public.key extract the public key from the private key file in the file test_public.key
3. File encryption (public key encryption): openssl rsautl -encrypt -in hello.txt -inkey test_pub.key -pubin -out hello.en encrypted before hello.txt encryption hello.en
4. decrypt the file (private key to decrypt): openssl rsautl -decrypt -in hello.en -inkey test.key -out hello.de
8. User Account and Group Management
-d specifies the home directory -u uid
-m If the home directory does not exist, create -M do not create the home directory
userdel -r username and delete user's home directory
Adding users to a group: usermod -a -G group name the user name used -a option does not enable the user from the previous group, a = append
9. modify kernel parameters
net.ipv4.icmp_echo_ignore_all = 1 # This ban ping host
net.ipv4.tcp_fin_timeout = 30 # Configure TIMEOUT time
net.ipv4.tcp_tw_reuse = 1 # Allow in the TIME-WAIT state ports for the new socket
sysctl -p effective immediately