LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 793|回复: 6

请教一个大家关于端口的问题

[复制链接]
发表于 2004-1-10 16:34:54 | 显示全部楼层 |阅读模式
我按照lfs50安装了系统,之后就安装了一个openssh
linux:~# ps aux
USER    PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root      1  1.3  0.4  1352  492 ?        S    00:31   0:03 init [3]
root   2  0.0  0.0     0    0 ?        SWN  00:31   0:00 [ksoftirqd/0]
root     3  0.0  0.0     0    0 ?        SW<  00:31   0:00 [events/0]
root     4  0.0  0.0     0    0 ?        SW<  00:31   0:00 [kblockd/0]
root      5  0.0  0.0     0    0 ?        SW   00:31   0:00 [pdflush]
root       6  0.0  0.0     0    0 ?        SW   00:31   0:00 [pdflush]
root       7  0.0  0.0     0    0 ?        SW   00:31   0:00 [kswapd0]
root         8  0.0  0.0     0    0 ?        SW<  00:31   0:00 [aio/0]
root       9  0.0  0.0     0    0 ?        SW   00:32   0:00 [kseriod]
root    10  0.0  0.0     0    0 ?        SW   00:32   0:00 [kjournald]
root   74  0.0  0.4  1416  588 ?        S    00:32   0:00 syslogd -m 0
root     77  0.0  1.0  2176 1248 ?        S    00:32   0:00 klogd
root     0.0  1.1  2988 1336 ?        S    00:32   0:00 /usr/sbin/sshd
root  0.3  1336  416 tty1     S    00:32   0:00 /sbin/agetty tty1 9600
root  0.3  1.3  5600 1588 ?        S    00:36   0:00 sshd: root@ttyp0
root       101  0.1  1.0  2388 1308 ttyp0    S    00:36   0:00 -bash
root       103  0.0  0.6  2184  748 ttyp0    R    00:36   0:00 ps aux

之后我扫描端口,发现除了22之外,还有两个端口开着,一个是389,一个是1002,请问这个是怎么回事,怎么将他关掉,谢谢
发表于 2004-1-10 22:54:31 | 显示全部楼层
你没事别运行sshd啊。
 楼主| 发表于 2004-1-11 02:11:02 | 显示全部楼层
sshd 我知道是作什么用的,我这个是作服务器用的,没有显示器的
问题是389,1002这个两个端口是作什么用的啊
 楼主| 发表于 2004-1-11 02:21:31 | 显示全部楼层
sshd 我知道是作什么用的,我这个是作服务器用的,没有显示器的
问题是389,1002这个两个端口是作什么用的啊
 楼主| 发表于 2004-1-11 02:26:06 | 显示全部楼层
也不是作什么用什么用
389我知道是ldap的
我问的是怎么关掉,用什么关
我刚才试了我装的debian的系统,全部应用全部关了以后,还是有这个两个端口开着,虽然说telnet它没有回应,但是到底是怎么回事,能帮我解释一下吗,谢谢
发表于 2004-1-11 10:50:39 | 显示全部楼层
使用lsof命令:
[root@localhost root]# lsof -i:22
COMMAND  PID USER   FD   TYPE DEVICE SIZE NODE NAME
sshd    3185 root    3u  IPv4   3089       TCP *:ssh (LISTEN)
sshd    3376 root    4u  IPv4   3450       TCP 192.168.0.66:ssh->192.168.0.27:1035 (ESTABLISHED)

以下内容来自man 8 lsof:
       The latest distribution of lsof is available via anonymous ftp from the
       host  vic.cc.purdue.edu.   You&acirc;&#8482;ll  find  the  lsof  distribution in the
       pub/tools/unix/lsof directory.

       You can also use this URL:

              ftp://vic.cc.purdue.edu/pub/tools/unix/lsof
发表于 2004-1-15 10:18:44 | 显示全部楼层
lsof,好命令。。

fuser也是干这类事情的,不过不如lsof好用。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表