红联Linux门户
Linux帮助

linux tips

发布时间:2006-09-08 00:42:33来源:红联作者:莫奕
检查空口令:
[code]awk -F: '($2 == "") { print $1 }' /etc/shadow[/code]
正常执行后应该没有任何显示.
如果是发现有输出显示的话就证明这个用户没有口令.
执行例子:
[code]root@testpc:[/root]awk -F: '($2 == "") { print $1 }' /etc/shadow
test

root@testpc:[/root]cat /etc/shadow|grep test
test::13251:0:99999:7:::[/code]

检查tcp/udp所有监听的服务以及进程名称:

[code]root@testpc:[/etc/pam.d]netstat -tulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:32768 *:* LISTEN 1060/rpc.statd
tcp 0 0 testpc:32769 *:* LISTEN 1197/xinetd
tcp 0 0 *:sunrpc *:* LISTEN 1041/portmap
tcp 0 0 *:auth *:* LISTEN 1197/xinetd
tcp 0 0 *:ssh *:* LISTEN 1183/sshd
tcp 0 0 testpc:ipp *:* LISTEN 1161/cupsd
tcp 0 0 testpc:smtp *:* LISTEN 1217/sendmail: acce
udp 0 0 *:32768 *:* 1060/rpc.statd
udp 0 0 *:812 *:* 1060/rpc.statd
udp 0 0 *:sunrpc *:* 1041/portmap
udp 0 0 *:ipp *:* 1161/cupsd[/code]
文章评论

共有 0 条评论