Edit/etc/hosts. allow and/etc/hosts. deny and set TCP kernel-level access control.
To allow/Deny Access From all addresses to all services, add the following entries:
All: all
To allow/deny access to the ssh service from 192.168.1.100, add the following entries:
Ssh: 192.168.1.100
When the policies in the two files conflict, the entries in hosts. allow take precedence.
If you are not skillful in configuring the iptables firewall, we recommend that you do not configure it remotely on the local console of the configured host, because, once a filter rule is configured that matches the current connection, the rule takes effect immediately and terminates the current connection. Some rules may cause logon failure even on the local host, for example, if you publish the "iptables-p input-j DROP" command as a filter rule, the system will not be able to log on to the host remotely or locally, you can cold start the host to solve this problem, because the iptables save command has not been released to save the rule settings.
Inconfig interface [[-net |-host] address [parameters]
Ipconfig eth0 192.168.0.1
Ipconfig eth1 203.99.9.9
The promisc parameter is used to place this ethereum interface in a "Chaotic" state, and-promisc cancels this state.
Netstat-r displays route information
Netstat-I is displayed in IP address format
Netstat-I list configuration features
Netstat-a lists all interfaces in the kernel
Netstat-t only lists TCP connections
Netstat-u only lists UDP connections
Core configuration file of/etc/host. conf bind server
Resolution configuration file of/etc/resolv. conf bind server
DNS databases contain three types of records:
A record maps host names to IP addresses
The CNAME record associates the host alias with its formal host name and points to A record.
The SOA record represents the Start of Authority, which contains common information about the zone to which the server belongs. For example, it contains the default t l value of all records.
If the host name is "The end is an absolute host name, that is, a complete standard host name containing the domain name, such as www.domain.com .), otherwise, it is a relative host name, indicating that the host name is associated with a domain name.
The special name "@" in the SOA record represents its own domain name.
The/etc/services file defines the conversion from service name to port number.
Df-kl view disk usage
Gunzip-dv filename.tar. Z is used to decompress the *. tar. Z file package into the *. tar file, and then use
Tar-xvf filename.tar to decompress the tar file. Among them,-v is used to show the decompression process.
Tar-cvf newfile.tar directory pack the directory into a tar package
/Etc/init. d/xinetd reload restart the xinetd service. It is used to modify the xinetd configuration file and reload the file without restarting the host.
Other parameters: start, stop, restart, status...
This command requires the root permission for execution.
Su-root-c xinetd reload # Run the xinetd command as root without changing the current shell
You can also:
Su-root-C' (cmd1; cmd2 )'
The bzip2 command is used to unbind the '.bz2' file.
Bzip2-d * .tar.bz2
For iso files, linux can use the mount command to read them, for example:
Mkdir/mnt/iso
Mount-t iso9660-o loop disc1.iso/mnt/iso
Ls/mnt/iso
Make a CD into an iso file (first mount the optical drive ):
Cp/mnt/cdrom disc1.iso
Decompress the. ZIP file to the new directory:
Unzip-d newdir file.zip
Check the disk blocks occupied by files or directories. in linux, each disk block is 1 k by default:
Du/tmp
Du/tmp/log.txt
View the number of detailed bytes occupied by the file directory:
Du-AB/tmp
Du-AB/tmp/log.txt
Download an object through http under the command line:
Wget http://www.download.com/file.exe
Continuous transfer: wget-c url
There are many other parameters, such as cache, http user authentication, and proxy authentication.
The rcp command can be used to copy files between linux Hosts.
List all services in the system and view the startup settings at the startup level of each system:
Chkconfig -- list
Modify the Service Startup settings (all system startup-level settings will be modified ):
Chkconfig srvname on | off
Start or stop a service:
Service srvname start | stop
View All service statuses:
Service -- status-all
The syslogd service of the system writes the log file/var/log/messages. Generally, messages of other applications are recorded in this file through syslogd.
However, use the following command for monitoring:
Tail-f/var/log/messages