FREEBSD中使用IPFW来过滤ICMP服务

来源:岁月联盟 编辑:zhu 时间:2007-01-08
FREEBSD中使用IPFW来过滤ICMP服务内容简介:############## #adduser.pl# ############## #!/usr/bin/perl $filename= ##############
# adduser.pl #
##############

#!/usr/bin/perl
$filename = 'class.txt' ;
open(file,$filename) ;
while( $name= ) {
chop $name ;
@name_array = split /,/,$name ;
$PW_COMMAND="/usr/sbin/pw useradd $name_array[0] -m -h 0" ;
$fname="|".$PW_COMMAND ; open(OUT, $fname) ;
print OUT $name_array[1] ;
close(OUT) ;
print "UserName: ",$name_array[0],"/t/t",
"Password: ",$name_array[1],"/n";
}
print "/n" ;
close(file) ;
 
################
# /etc/pw.conf #
################
logfile /root/pw.log
defaultpasswd yes
home /home
defaultshell /usr/local/bin/bash
defaultgroup user
reuseuids yes
minuid 2000
 
##############
# 额外说明   #
##############
1.home   -->预设的家目录
defaultshell -->预设的shell路径
defaultgroup -->预设的群组
1.minuid -->起始的uid

############
# 使用方式 #
############
1.先备档案 
 a. adduser.pl 
 b. /etc/pw.conf
 c. 帐号的来源档 class.txt
    形式:
    帐号,密码
    帐号,密码
2.步骤
 a.将adduser.pl改为可以执行
    chmod 700 adduser.pl
 b.adduser.pl及class.txt需在同一目录下,不然则需更改路径
 c.执行adduser.pl
 d.完成

图片内容