ftp 服务器相关
2016-04-11 09:59
603 查看
1. 安装 vsftpd
#sudo
apt-get install vsftpd
2.
重启
#sudo
service vsftpd restart
3. 新建"/home/uftp"目录作为用户主目录
#sudo
mkdir /home/uftp
4. 新建用户uftp并设置密码
#sudo
useradd -d /home/uftp -s /bin/bash uftp
5.
配置
/etc/vsftpd.conf文件
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/allowed_users
seccomp_sandbox=NO
local_enable=YES
/etc/allowed_users文件
加入用户uftp
/etc/ftpusers文件
为不可访问的用户,确保uftp没在列表
6.
问题
a.
如何使用户a可以访问匿名目录
和ftp配置默认配置无关,只需匿名目录权限开放即可
b.如何使用户a只能访问自己的home目录
1.
uncommend:chroot_list_file=/etc/vsftpd/chroot_list (/etc/vsftpd/vsftpd.conf)
2. 添加用户a到/etc/vsftpd/chroot_list
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
注1:
以上为ubuntu,
如果centos,好像只需确认/etc/allowed_users文件文件,其他默认ok。
注2:
注意用户根目录访问权限的设置 如uftp目录
注3:
匿名无密码访问需保证:anonymous_enable=YES
默认路径:/var/ftp
c. 更新密码后,如果不重启ftp服务,windows 访问会有以下错误(restart after updating password)
"Windows cannot access
this folder. Make sure you have typed the file name correctly and that you have permission to access the folder."
#sudo
apt-get install vsftpd
2.
重启
#sudo
service vsftpd restart
3. 新建"/home/uftp"目录作为用户主目录
#sudo
mkdir /home/uftp
4. 新建用户uftp并设置密码
#sudo
useradd -d /home/uftp -s /bin/bash uftp
5.
配置
/etc/vsftpd.conf文件
userlist_deny=NO
userlist_enable=YES
userlist_file=/etc/allowed_users
seccomp_sandbox=NO
local_enable=YES
/etc/allowed_users文件
加入用户uftp
/etc/ftpusers文件
为不可访问的用户,确保uftp没在列表
6.
问题
a.
如何使用户a可以访问匿名目录
和ftp配置默认配置无关,只需匿名目录权限开放即可
b.如何使用户a只能访问自己的home目录
1.
uncommend:chroot_list_file=/etc/vsftpd/chroot_list (/etc/vsftpd/vsftpd.conf)
2. 添加用户a到/etc/vsftpd/chroot_list
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
注1:
以上为ubuntu,
如果centos,好像只需确认/etc/allowed_users文件文件,其他默认ok。
注2:
注意用户根目录访问权限的设置 如uftp目录
注3:
匿名无密码访问需保证:anonymous_enable=YES
默认路径:/var/ftp
c. 更新密码后,如果不重启ftp服务,windows 访问会有以下错误(restart after updating password)
"Windows cannot access
this folder. Make sure you have typed the file name correctly and that you have permission to access the folder."
相关文章推荐
- getParent()与getParentFile()的区别
- PHP读取mssql json数据中文乱码的解决办法
- php Curl_setop 的学习
- PHP模板引擎Smarty中的保留变量用法分析
- 每天laravel-20160710|Event
- 每天laravel-20160709|CallEvent
- PHP的htmlspecialchars、strip_tags、addslashes解释
- PHP正则表达式验证是否含有中文
- phpmyadmin没有接收到要导入的数据.可能是文件名没有提交,也可能是文件大小超出 PHP 限制.
- PHP学习路线
- php防止重复提交表单
- PHP模板引擎Smarty内建函数foreach,foreachelse用法分析
- PHP学习摘要
- PHP读取mssql,json数据中文乱码
- Parse error: syntax error, unexpected $end in D:\www\xxx\e\class\adminfun.php
- yesterday.php 打印日期
- PHP模板引擎Smarty之配置文件在模板变量中的使用方法示例
- php max() min() 返回最大值和最小值
- php模拟post方式提交数据
- max_min.php