文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>configurate vsftp server

configurate vsftp server

时间:2006-04-09  来源:wxb517xz

1 vi account

  Izqupload

  Izqizq

  Izqdownload

  Itvitv

  Izqadmin

  Admin    

  ……..      (single file:username ,double file:password)

 

2 # db_load -T -t hash -f account /etc/vsftpd/account.db

  #chmod 600 /etc/vsftpd/account.db

 

3 vi /etc/pam.d/vsftp.izq

auth required /lib/security/pam_userdb.so db=/etc/vsftpd/account

account required /lib/security/pam_userdb.so db=/etc/vsftpd/account

 

4 #useradd -d /home/ftpsite ftpvirtual

#chmod 700 /home/ftpsite

 

5 #vi /etc/vsftpd.conf

guest_enable=YES(start virtual user)

guest_username=ftpvirtual(map users to local virtualuser )

pam_service_name=vsftp.izq(link the pam file)

user_config_dir=/etc/vsftpd/userconf(link kinds of config file for virtual users)

 

6 open different authority  

#vi /etc/vsftpd/userconf/izqdownload

anon_world_readable_only=NO (open download authority ,only download;NOTE:don’t set up “YES” otherwise can not display to catalog and files)

 

#vi /etc/vsftpd/userconf/upload

anon_world_readable_only=NO

write_enable=YES (add write authority)

anon_upload_enable=YES(and upload authority)

 

#vi /etc/vsftpd/userconf/admin

anon_world_readable_only=NO

write_enable=YES

anon_upload_enable=YES

anon_other_write_enable=YES (add delete/rename authority)

anon_mkdir_write_enable=YES  ( add create catalog authority)

 

7 mkdir /home/ftpsite/customer

  Cd /etc/vsftpd/userconf

 Vi /etc/vsftpd/usrconf/customer

Local root=/home/ftpsite/service (limit the username use to this catalog)

  Chown ftpvirtual  ftpvitual ./customer

  Chmod 600 /home/ftpsite/customer

 

8 chown root root /var/ftp

  Chmod og-rw /var/ftp

 

9 oter parameter for vsftpd.conf

idle_session_timeout=600 (client timeout )

data_connection_timeout=120

ftpd_banner=Welcome to d-1701.com FTP service.  //FTP welcome information 

anon_max_rate=80000  //anonymous user limit 80KBytes/s

chroot_local_user=YES  //limit user on self catalog

virtual_use_local_privs=YES  //virtual users  authority equally common user

pasv_enable=YES   / /enable pasv pattern  

 

10 used by quota

Vi /etc/fstab

LABEL=/home   /home   ext3   defaults ,ftpvirtual ftpvirtual    1 2   (add)

quotacheck –avu  (a:auto start filesystem v:show information u:start user quota/g:start group quota)

eg. Filesystem       blocks     soft     hard   inodes   soft   hard

/dev/sda6       424       500000       0       13     0     0  (sda6->home, soft limit:50000k ,0 : no quato )

quota ftpvirtual (check ftpvirtual’s quato)

quotaoff -vug /dev/sda6     //remove home quota

 

 

remark: vsftpd主要配置参数详细整理

#接受匿名用户

anonymous_enable=YES

#匿名用户login时不询问口令

no_anon_password=YES

#匿名用户主目录

anon_root=(none)

#接受本地用户

local_enable=YES

#本地用户主目录

local_root=(none)

#如果匿名用户需要密码,那么使用banned_email_file里面的电子邮件地址的用户不能登录

deny_email_enable=YES

#仅在没有pam验证版本时有用,是否检查用户有一个有效的shell来登录

check_shell=YES

#若启用此选项,userlist_deny选项才被启动

userlist_enable=YES

#若为YES,则userlist_file中的用户将不能登录,为NO则只有userlist_file的用户可以登录

userlist_deny=NO

#如果和chroot_local_user一起开启,

那么用户锁定的目录来自/etc/passwd每个用户指定的目录(这个不是很清楚,很哪位熟悉的指点一下)

passwd_chroot_enable=NO

#定义匿名登入的使用者名称。默认值为ftp。

ftp_username=FTP

 

#################用户权限控制###############

#可以上传(全局控制).

write_enable=YES

#本地用户上传文件的umask

local_umask=022

#上传文件的权限配合umask使用

#file_open_mode=0666

#匿名用户可以上传

anon_upload_enable=NO

#匿名用户可以建目录

anon_mkdir_write_enable=NO

匿名用户其它的写权利(更改权限?)

anon_other_write_enable=NO

如果设为YES,匿名登入者会被允许下载可阅读的档案。默认值为YES。

anon_world_readable_only=YES

#如果开启,那么所有非匿名登陆的用户名都会被切换成guest_username指定的用户名

#guest_enable=NO

所有匿名上传的文件的所属用户将会被更改成chown_username

chown_uploads=YES

匿名上传文件所属用户名

chown_username=lightwiter

#如果启动这项功能,则所有列在chroot_list_file之中的使用者不能更改根目录

chroot_list_enable=YES

#允许使用\"async ABOR\"命令,一般不用,容易出问题

async_abor_enable=YES

管控是否可用ASCII 模式上传。默认值为NO。

ascii_upload_enable=YES

#管控是否可用ASCII 模式下载。默认值为NO。

ascii_download_enable=YES

#这个选项必须指定一个空的数据夹且任何登入者都不能有写入的权限,

当vsftpd 不需要file system 的权限时,就会将使用者限制在此数据夹中。

默认值为/usr/share/empty

secure_chroot_dir=/usr/share/empty

 

###################超时设置##################

#空闲连接超时

idle_session_timeout=600

#数据传输超时

data_connection_timeout=120

#PAVS请求超时

ACCEPT_TIMEOUT=60

#PROT模式连接超时

connect_timeout=60

 

################服务器功能选项###############

#开启日记功能

xferlog_enable=YES

#使用标准格式

xferlog_std_format=YES

#当xferlog_std_format关闭且本选项开启时,记录所有ftp请求和回复,当调试比较有用.

#log_ftp_protocol=NO

#允许使用pasv模式

pasv_enable=YES

#关闭安全检查,小心呀.

#pasv_promiscuous+NO

#允许使用port模式

#port_enable=YES

#关闭安全检查

#prot_promiscuous

#开启tcp_wrappers支持

tcp_wrappers=YES

#定义PAM 所使用的名称,预设为vsftpd。

pam_service_name=vsftpd

#当服务器运行于最底层时使用的用户名

nopriv_user=nobody

#使vsftpd在pasv命令回复时跳转到指定的IP地址.(服务器联接跳转?)

pasv_address=(none)

 

#################服务器性能选项##############

#是否能使用ls -R命令以防止浪费大量的服务器资源

#ls_recurse_enable=YES

#是否使用单进程模式

#one_process_model

#绑定到listen_port指定的端口,既然都绑定了也就是每时都开着的,就是那个什么standalone模式

listen=YES

#当使用者登入后使用ls -al 之类的指令查询该档案的管理权时,预设会出现拥有者的UID,

而不是该档案拥有者的名称。若是希望出现拥有者的名称,则将此功能开启。

text_userdb_names=NO

#显示目录清单时是用本地时间还是GMT时间,可以通过mdtm命令来达到一样的效果

use_localtime=NO

#测试平台优化

#use_sendfile=YES

 

################信息类设置################

#login时显示欢迎信息.如果设置了banner_file则此设置无效

ftpd_banner=欢迎来到湖南三辰Fake-Ta FTP 网站.

#允许为目录配置显示信息,显示每个目录下面的message_file文件的内容

dirmessage_enable=YES

#显示会话状态信息,关!

#setproctitle_enable=YES

 

############## 文件定义 ##################

#定义不能更改用户主目录的文件

chroot_list_file=/etc/vsftpd/vsftpd.chroot_list

#定义限制/允许用户登录的文件

userlist_file=/etc/vsftpd/vsftpd.user_list

#定义登录信息文件的位置

banner_file=/etc/vsftpd/banner

#禁止使用的匿名用户登陆时作为密码的电子邮件地址

banned_email_file=/etc/vsftpd.banned_emails

#日志文件位置

xferlog_file=/var/log/vsftpd.log

#目录信息文件

message_file=.message

 

############## 目录定义 #################

#定义用户配置文件的目录

user_config_dir=/etc/vsftpd/userconf

#定义本地用户登陆的根目录,注意定义根目录可以是相对路径也可以是绝对路径

.相对路径是针对用户家目录来说的.

local_root=webdisk #此项设置每个用户登陆后其根目录为/home/username/webdisk

#匿名用户登陆后的根目录

anon_root=/var/ftp

 

#############用户连接选项#################

#可接受的最大client数目

max_clients=100

#每个ip的最大client数目

max_per_ip=5

#使用标准的20端口来连接ftp

connect_from_port_20=YES

#绑定到某个IP,其它IP不能访问

listen_address=192.168.0.2

#绑定到某个端口

#listen_port=2121

#数据传输端口

#ftp_data_port=2020

#pasv连接模式时可以使用port 范围的上界,0 表示任意。默认值为0。

pasv_max_port=0

#pasv连接模式时可以使用port 范围的下界,0 表示任意。默认值为0。

pasv_min_port=0

 

##############数据传输选项#################

#匿名用户的传输比率(b/s)

anon_max_rate=51200

#本地用户的传输比率(b/s)

local_max_rate=5120000

 

########################################

相关阅读 更多 +
排行榜 更多 +
乐乐太空杀安卓版

乐乐太空杀安卓版

棋牌卡牌 下载
利刃战锤

利刃战锤

棋牌卡牌 下载
血债血偿2街头乱战Payback 2

血债血偿2街头乱战Payback 2

飞行射击 下载