CentOS 6.3 FTP 安装vsftp虚拟用户设置全解

上传人:飞*** 文档编号:40229307 上传时间:2018-05-24 格式:DOC 页数:23 大小:94KB
返回 下载 相关 举报
CentOS 6.3 FTP 安装vsftp虚拟用户设置全解_第1页
第1页 / 共23页
CentOS 6.3 FTP 安装vsftp虚拟用户设置全解_第2页
第2页 / 共23页
CentOS 6.3 FTP 安装vsftp虚拟用户设置全解_第3页
第3页 / 共23页
CentOS 6.3 FTP 安装vsftp虚拟用户设置全解_第4页
第4页 / 共23页
CentOS 6.3 FTP 安装vsftp虚拟用户设置全解_第5页
第5页 / 共23页
点击查看更多>>
资源描述

《CentOS 6.3 FTP 安装vsftp虚拟用户设置全解》由会员分享,可在线阅读,更多相关《CentOS 6.3 FTP 安装vsftp虚拟用户设置全解(23页珍藏版)》请在金锄头文库上搜索。

1、一、准备安装环境:CentOS 6.3安装:Minimal(最小)注意:修改时区和时间所需要的软件:vsftp http pam db4-devel ftp(客户端安装包)二、安装:1.安装 Vsftpd 服务相关部件:rootserver # rpm -qa |grep vsftprootserver # yum install vsftpd* -y2.确认安装 PAM 服务相关部件:rootserver # rpm -qa |grep pamrootserver # yum install pam* 开发包,其实不装也没有关系,主要的目的是确认 PAM。3.安装 DB4 部件包:这里要特别

2、安装一个 db4 的包,用来支持文件数据库。rootserver # rpm -qa |grep db4rootserver # yum install db4*确保 DB4 工具包安装:db4-utils-4.7.25-17.el6.i6864.安装 http 软件包:rootserver # yum install httpd* 三、系统帐户1.建立系统帐户:rootserver # useradd ftp01rootserver # passwd ftp01更改用户 ftp01 的密码 。新的 密码:无效的密码: 它没有包含足够的不同字符无效的密码: 是回文重新输入新的 密码:passw

3、d: 所有的身份验证令牌已经成功更新。2.建立 Vsftpd 服务的宿主用户:rootserver #useradd vsftpd -s /sbin/nologin默认的 Vsftpd 的服务宿主用户是 root,但是这不符合安全性的需要。这里建 立名字为 vsftpd 的用户,用他来作为支持 Vsftpd 的服务宿主用户。由于该用 户仅用来支持 Vsftpd 服务用,因此没有许可他登陆系统的必要,并设定他为不 能登陆系统的用户。3.建立 Vsftpd 虚拟宿主用户:rootserver #useradd virtusers -s /sbin/nologin本篇主要是介绍 Vsftp 的虚拟用

4、户,虚拟用户并不是系统用户,也就是说这些 FTP 的用户在系统中是不存在的。他们的总体权限其实是集中寄托在一个在系 统中的某一个用户身上的,所谓 Vsftpd 的虚拟宿主用户,就是这样一个支持着 所有虚拟用户的宿主用户。由于他支撑了 FTP 的所有虚拟的用户,那么他本身 的权限将会影响着这些虚拟的用户,因此,处于安全性的考虑,也要非分注意 对该用户的权限的控制,该用户也绝对没有登陆系统的必要,这里也设定他为 不能登陆系统的用户。四、调整 Vsftpd 的配置文件1.编辑配置文件前先备份rootserver #cp /etc/vsftpd/vsftpd.conf /etc/vsftpd/vsft

5、pd.confbak编辑主配置文件 vsftpd.confrootserver #vim /etc/vsftpd/vsftpd.conf这里我将原配置文件的修改完全记录,凡是修改的地方我都会保留注释原来的 配置。其中加入我对每条配置项的认识,对于一些比较关键的配置项这里我做 了我的观点,并且原本英语的说明我也不删除,供参考对比用。- -# Example config file /etc/vsftpd/vsftpd.conf# The default compiled in settings are fairly paranoid. This sample file# loosens thin

6、gs up a bit, to make the ftp daemon more usable.# Please see vsftpd.conf.5 for all compiled in defaults.# READ THIS: This example file is NOT an exhaustive list of vsftpd options.# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpds# capabilities.# Allow anonymous FTP? (Beware -

7、allowed by default if you comment this out).#anonymous_enable=YESanonymous_enable=NO /设定不允许匿名访问# Uncomment this to allow local users to log in.local_enable=YES /设定本地用户可以访问。注意:主要是为虚拟宿 主用户, 如果该项目设定为 NO 那么所有虚拟用户将无法访 问。# Uncomment this to enable any form of FTP write command.write_enable=YES /设定可以进行写操作。

8、# Default umask for local users is 077. You may wish to change this to 022,# if your users expect that (022 is used by most other ftpds)local_umask=022 /设定上传后文件的权限掩码。# Uncomment this to allow the anonymous FTP user to upload files. This only# has an effect if the above global write enable is activat

9、ed. Also, you will# obviously need to create a directory writable by the FTP user.#anon_upload_enable=YESanon_upload_enable=NO /禁止匿名用户上传。# Uncomment this if you want the anonymous FTP user to be able to create# new directories.#anon_mkdir_write_enable=YESanon_mkdir_write_enable=NO /禁止匿名用户建立目录。# Acti

10、vate directory messages - messages given to remote users when they# go into a certain directory.dirmessage_enable=YES /设定开启目录标语功能。# Activate logging of uploads/downloads.xferlog_enable=YES /设定开启日志记录功能。# Make sure PORT transfer connections originate from port 20 (ftp- data).connect_from_port_20=YES /

11、设定端口 20 进行数据连接。# If you want, you can arrange for uploaded anonymous files to be owned by# a different user. Note! Using “root“ for uploaded files is not# recommended!#chown_uploads=YESchown_uploads=NO /设定禁止上传文件更改宿主。#chown_username=whoeverchroot_local_user=YES /设定登陆后.只可以访问自己的属主目录.不 可访问上一层目录文件# You m

12、ay override where the log file goes if you like. The default is shown# below.xferlog_file=/var/log/vsftpd.log /设定 Vsftpd 的服务日志保存路径。 注意,该文件默认不存在。必须要手动 touch 出来,并且由于这里更改了 Vsftpd 的服务宿主用户为手动建立的 Vsftpd。必须注意给与该用户对日志的写 入权限,否则服务将启动失败。# If you want, you can have your log file in standard ftpd xferlog formatx

13、ferlog_std_format=YES /设定日志使用标准的记录格式。# You may change the default value for timing out an idle session.#idle_session_timeout=600 /设定空闲连接超时时间,这里使用默认。 将具体数值留给每个具体用户具体指定,当然如果不指定的话,还是使用这里 的默认值 600,单位秒。# You may change the default value for timing out a data connection.#data_connection_timeout=120 /设定单次最

14、大连续传输时间,这里使 用默认。将具体数值留给每个具体用户具体指定,当然如果不指定的话,还是 使用这里的默认值 120,单位秒。# It is recommended that you define on your system a unique user which the# ftp server can use as a totally isolated and unprivileged user.#nopriv_user=ftpsecurenopriv_user=vsftpd /设定支撑 Vsftpd 服务的宿主用户为手动建立的 Vsftpd 用户。注意,一旦做出更改宿主用户后,必须注意

15、一起与该服务相关的 读写文件的读写赋权问题。比如日志文件就必须给与该用户写入权限等。# Enable this and the server will recognise asynchronous ABOR requests. Not# recommended for security (the code is non-trivial). Not enabling it,# however, may confuse older FTP clients.async_abor_enable=YES /设定支持异步传输功能。# By default the server will pretend to allow ASCII mode but in fact ignore# the request. Turn on the below options to have the server actually do ASCII# mangling on files when in ASCII mode.# Beware that on some FTP server

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 研究报告 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号