繁体中文
设为首页
加入收藏
当前位置:操作系统首页 >> Freebsd >> FREEBSD中使用IPFW来过滤ICMP服务

FREEBSD中使用IPFW来过滤ICMP服务

2007-07-28 09:55:44  作者:  来源:互联网  浏览次数:582  文字大小:【】【】【
简介:##############
# 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.完成
##############
# 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.完成

责任编辑:


相关文章
 

最新文章

更多

· FreeBSD 5-CURRENT 的内...
· 在FreeBSD中安装双网卡实例
· FreeBSD WEB服务器架设笔记
· 利用 portupgrade快速更...
· 在FREEBSD 5.2中使用Pur...
· FreeBSD与Linux的比较
· BSD系统全家福
· freebsd5.2.1上安装vmwa...
· 怎样编译FreeBSD内核
· FREEBSD中使用IPFW来过滤...

推荐文章

更多

· FreeBSD 5-CURRENT 的内...
· 在FreeBSD中安装双网卡实例
· FreeBSD WEB服务器架设笔记
· 利用 portupgrade快速更...
· 在FREEBSD 5.2中使用Pur...
· FreeBSD与Linux的比较
· BSD系统全家福
· freebsd5.2.1上安装vmwa...
· 怎样编译FreeBSD内核
· FREEBSD中使用IPFW来过滤...

热点文章

更多