To reduce the risks of linux hosts, we should try to cancel or delete unnecessary services. Let's take a look at what ports are currently open [root @ localhostlinsc] # nmap127.0.0.1Startingnmap3.70 (http://www.insecure.org/nmap/) at2007-12-0521: 28 CSTInterestingportso in order to make linux host less hidden, we should try our best to cancel or delete unnecessary services.
Let's take a look at which ports are currently on.
[Root @ localhost linsc] # nmap 127.0.0.1
Starting nmap 3.70 (http://www.insecure.org/nmap/) at CST
Interesting ports on localhost. localdomain (127.0.0.1 ):
(The 1652 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
766/tcp open unknown
3306/tcp open mysql
8009/tcp open ajp13
8080/tcp open http-proxy
Nmap run completed -- 1 IP address (1 host up) scanned in 0.194 seconds
We can see that Port 766 is open and an unknown service is running. what service is this? At this time, I do not know.
[Root @ localhost linsc] # netstat-lp
The following content is displayed,
Tcp 0 0 *: 766 *: * LISTEN 3128/rpc. statd
This indicates that rpc. statd is running.
Let's take a look at the other method of listening port for command execution in 766.
[Root @ localhost linsc] # lsof-I: 766
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
Rpc. statd 3128 rpcuser 8u IPv4 6467 TCP *: 766 (LISTEN)
Check that the rpc. statd command is the document of the installation package.
[Root @ localhost linsc] # rpm-qf/sbin/rpc. statd
Nfs-utils-1.0.6-80.EL4
Check what starts with nfs
[Root @ localhost linsc] # ls/etc/init. d/nfs *
/Etc/init. d/nfs/etc/init. d/nfslock
View nfslock status
[Root @ localhost linsc] #/etc/init. d/nfslock status
Rpc. statd (pid 3128) is running...
[Root @ localhost linsc] # vi/etc/services
Find the nfs in it, add # Comment out in front, restart,
[Root @ localhost linsc] # nmap 127.0.0.1
Starting nmap 3.70 (http://www.insecure.org/nmap/) at CST
Interesting ports on localhost. localdomain (127.0.0.1 ):
(The 1653 ports scanned but not shown below are in state: closed)
PORT STATE SERVICE
21/tcp open ftp
22/tcp open ssh
25/tcp open smtp
80/tcp open http
3306/tcp open mysql
8009/tcp open ajp13
8080/tcp open http-proxy
Nmap run completed -- 1 IP address (1 host up) scanned in 0.194 seconds
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