setpasswd.exp
代码: #! /usr/local/bin/expect -f #username is passed as 1st arg,passWord as 2nd set password [lindex $argv 1] spawn passwd [lindex $argv 0] expect "*Password:" send "$passwordr" expect "*Password:" send "$passwordr" expect eof
ftpuseradd
代码: #!/sbin/sh # ftpuseradd usage() { echo "Usage: `basename $0` [-w] [-m maxrate] username password" exit 1 } WRITABLE="no" # can"t upload MAXRATE="64000" # default max rate is 64Kb OPT="no" while getopts :wm: OPTION docase $OPTION inw) WRITABLE="yes"OPT="yes"m) MAXRATE=$OPTARGOPT="yes"?) usageesac done shift `expr $OPTIND - 1` if [ $# -ne 2 ] thenusage fi USERNAME=$1 PASSWORD=$2 useradd -d /dev/null -g ftp -s /bin/false $USERNAME if [ $? -eq 0 ] thensetpasswd.exp $USERNAME $PASSWORD > /dev/nullecho "anon_world_readable_only=NO" > /etc/vsftpd/$USERNAMEecho "anon_max_rate=$MAXRATE" >> /etc/vsftpd/$USERNAMEif [ "$WRITABLE" = "yes" ]thenecho "write_enable=YES" >> /etc/vsftpd/$USERNAMEecho "anon_upload_enable=YES" >> /etc/vsftpd/$USERNAMEecho "anon_mkdir_write_enable=YES" >> /etc/vsftpd/$USERNAMEecho "anon_other_write_enable=YES" >> /etc/vsftpd/$USERNAMEfiecho "$USERNAME" >> /etc/vsftpd.user_listmkdir /data/ftp/$USERNAMEchown ftp:ftp /data/ftp/$USERNAME fi
ftpuserdel
代码: #!/sbin/sh # ftpuserdel usage() { echo "Usage: `basename $0` [-r] username" exit 1 } REMOVEDIR="no" while getopts :r OPTION docase $OPTION inr) REMOVEDIR="yes"?) usageesac done shift `expr $OPTIND - 1` if [ $# -ne 1 ] thenusage fi USERNAME=$1 userdel $USERNAME if [ $? -eq 0 ] thenif [ -f /etc/vsftpd.user_list ]thencat /etc/vsftpd.user_list | sed "/^$USERNAME$/d" | sed "1,$ w /etc/vsftpd.user_list" > /dev/nullfiif [ -f /etc/vsftpd/$USERNAME ]thenrm -f /etc/vsftpd/$USERNAME > /dev/nullfiif [ -d /data/ftp/$USERNAME -a "$REMOVEDIR" = "yes" ]thenrm -rf /data/ftp/$USERNAME > /dev/nullfi fi
ftppasswd
代码: #!/sbin/sh # ftppasswd usage() { echo "Usage: `basename $0` username password" exit 1 } if [ $# -ne 2 ] thenusage fi USERNAME=$1 PASSWORD=$2 setpasswd.exp $USERNAME $PASSWORD
6.参考:
Manpage of VSFTPD.CONF,http://vsftpd.beasts.org/vsftpd_conf.html
Freeware for Solaris, http://www.sunfreeware.com/
在SOLARIS上编译安装VSFTPD, http://bbs.chinaunix.net/forum/viewtopic.php?t=344943
(T111)
推荐阅读
- OK状态下boot命令及参数
- 像什么像什么造句 像什么像什么造句举例
- Sun Solaris 用户手册 -- 三.系统安装
- 地下城洞察之眼门槛奶多少
- 图怪兽下载的图片保存在哪里
- 给想买1110的朋友坚定下信心
- 以下哪个技能是嘲讽技能
- 太阳下山了也会有灯打开什么意思
- C Yassp工具包安装安全的 Solaris 系统
- 怎样利用矿泉水瓶通下水管道