CentOS installation nmap port viewing tool

 Nmap (Network Mapper) is a commonly used network management tool in the Linux system, which can scan ports, sniff the network environment of the host, etc. 1、 Install nmap #yum -y install nmap 2、 Use nmap #Nmap localhost # View the current open ports of the host #Nmap - p 20-65535 localhost # View the open ports in the host port (20-65535) #Nmap - PS 107.161.19.25 # Detect the open port of the target host #Nmap -- help # Please query help information for more nmap parameters 3、 Turn off or open the host port 1. Nmap localhost # View the current open ports of the host 2. Ntsysv # Open the system server manager (you need to install yum install ntsysv first), and select the service to close or open Chinese reference guide: http://nmap.org/man/zh/

 NMAP

Linux network no find eth0

 Linux network no find eth0 Applicable to: 1:Red Hat Linux 2:CentOS #/etc/sysconfig/network-scripts #vi ifcfg-eth0 #Set ONBOOT=no to ONBOOT=yes. #service network restart

 eth0 (1)  eth0 (2)  eth0 (3)  eth0 (4)  eth0 (5)  eth0 (6)  eth0 (7)  eth0 (8)

Redirects

 Redirects 1、 Redirect type - temporary or permanent 302 Temporary redirection 301 Permanent Redirect 2、 Fill in the URL you want to redirect to in the "Redirects to" area (the protocol type must be indicated, such as http://, https://, etc.) 3、 Select www. Redirection (1) "Only www redirection can be used", then only when a customer visits a page with www will he be redirected to a new page (2) "Use or not use www redirection", then when customers visit pages with or without www, they will be redirected to new pages (3) "Do not redirect www", then when customers visit a page with www, they will not be redirected to a new page (4) "Wild Card" redirection will redirect all directories to a new directory with the same file name. For example, bbs.h3cne.cn is redirected to wp.h3cne.cn. When a customer accesses bbs.h3cne.cn/pic.jpg, it will be redirected to wp.h3cne.cn/pic.jpg (No external card) http://wp.h3cne.cn/wp-content/uploads/2014/01/Inpaint.png http://bbs.h3cne.cn/wp-content/uploads/2014/01/Inpaint.png (Unable to open) (wild card) http://links.h3cne.cn/wp-content/uploads/2014/01/Inpaint.png (Auto Jump) http://wp.h3cne.cn/wp-content/uploads/2014/01/Inpaint.png

 Redirects

Linux prohibits direct login of root account

 Linux prohibits direct login of root account The default administrator of Linux is root. You only need to know the ROOT password to log in to SSH directly. Disabling Root from logging in directly from SSH can improve server security. 1、 New Account #useradd admin 2、 Set account password #passwd admin 3、 Do not allow root to log in directly 1. Modify related documents #vi /etc/ssh/sshd_config 2. Disable root login Find "# PermitRootLogin yes", remove the previous "#", change the latter "Yes" to "No", save the file, and restart # reboot. 4、 Login 1. First, use the new account "admin" to log in as an ordinary user. (Using root will deny login) 2. To obtain ROOT permission, execute the following command in SSH #su root Execute the above command and enter the root password to obtain root permission. 5、 When SFTP logs in as admin, folders such as root cannot be opened.

 deny root login deny root login 2

SSH port modification under Linux

 SSH port modification under Linux 1: Statistics of SSH login failures: #cat /var/log/secure|awk '/Failed/{print $(NF-3)}'|sort|uniq -c|awk '{print $2"="$1;}' 2: # vi/etc/ssh/sshd_config (Modify Configuration File) First remove the # in front of Port 22 and start a new line. Define the SSH port number as 2039, then enter Port 2039 (# is the comment character of Linux) For the above operations, manually specify the SSH ports as 22 and 2039 (dual port slogans). 22 is reserved to prevent individual firewalls from blocking other ports and making VPS connection impossible. 3: Restart SSH. CentOS Restart SSH: service sshd restart DeBian restarts SSH: service ssh restart 4: If all can be accessed normally, delete the original Port 22 according to the operation in Step 2, and then restart SSH according to Step 3.

 SSH Port (1)  SSH Port (2)