文档详情

第11章 FTP 服务器.ppt

发布:2017-06-15约字共49页下载文档
文本预览下载声明
Ftp服务器配置案例 以user用户登录,登录成功后下载在文件 Ftp服务器配置案例 下载成功后,在windows目录中看到了tt.txt文件。 在windows 文件夹中新建一文件 new.txt, 在windows命令窗口中执行文件上传命令put,把new.txt 文件上传。在Linux远端文件夹中显示上传成功后的内容。 【例11-1】 配置vsftpd服务器,要求只允许匿名用户登录,本地用户不允许登录。匿名用户可在/var/ftp/pub目录中新建目录、上传和下载文件。 1。编辑vsftpd.conf文件,修改其中的配置选项如下: Anonymous_enable= Lacal_enable= Write_enable= Anon_upload_enable= Anon_mkdir_write_enable= Connect_ from_ port_ 20= yes Listen =yes Tcp_wrappers =yes yes no yes yes yes 2. 修改/var/ftp/pub目录权限,允许属主、同组及其他用户写入文件。 [root@localhost root]# cd /var/ftp [root@localhost root]# chmod 777 pub [root@localhost root]# ls –l 3. 重新启动vsftpd服务器 [root@localhost root]# service vsftpd restart 4.测试中,以匿名用户登录,输入密码为空,匿名用户可在/var/ftp/pub目录中新建目录、上传和下载文件。在之前一定要修改用户权限。 【例11-2】 配置vsftpd服务器,要求只允许xh本地用户登录。 1. 编辑vsftpd,conf文件,修改配置文件选项如下: Anonymous_enable= Local_enable= Write_enable= Connect_ from_ port_ 20= yes userlist_enable= userlist_deny= Listen =yes Tcp_wrappers =yes no yes yes yes no 2)编辑user_list文件,使其一定包含用户xh。 user_list文件中 保留用户列表,其是否起效取决于vsftpd.conf文件中的userlist_enable参数。 userlist_deny= no,表示只有在user_list文件中存在的用户才有权访问vsftpd服务器; userlist_deny=yes,表示user_list文件中存在的用户无权访问vsftpd服务器。 [root@localhost root]#vi user_list xh 3)重新启动vsftpd服务。 [root@localhost root]# service vsftpd restart 4) 连接ftp服务器,以xh用户的身份登录,用户登录成功后能够创建目录,能够上传和下载文件。如下图所示。 11-4 vsftpd高级配置 启用ASCII传输方式(把两项前的#号去 掉即可) ascii_upload_enble=yes ascii_download_enble=yes 2. 设置连接服务器后的欢迎信息 ftpd_banner=welcome to ftp service. banner_file=/var/vsftpd_banner_file 3. 配置基本的性能和安全选项 idle_session_timeout=60 //设置用户会话的空闲中断时间(秒) data_connection_timeout=120 //设置空闲的数据连接的中断时间 accept_timeout=60 connect_timeout=60 //设置客户端空闲时自动中断和激活连接时间 max_clients=200 //指明服务器总的客户并发连接数为200 max_per_ip=3 //指明每个客户机的最大连接数为3 local_max_rate=50000(50kby
显示全部
相似文档