通过修改改/etc/hosts.allow 来实现访问控制 但是有个小问题(详见155楼(第11页))
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
sudo mkdir /var/ftp/123
sudo chmod 777 /var/ftp/123
cc@thinkpad:~$ sudo service vsftpd restart
[sudo] password for cc:
vsftpd stop/waiting
vsftpd start/running, process 4542
cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
然后重启虚拟机就找到了
可用了
上传了个文件一看确实是/var/ftp文件夹
sudo chmod 777 /var/ftp/123
cc@thinkpad:~$ sudo service vsftpd restart
[sudo] password for cc:
vsftpd stop/waiting
vsftpd start/running, process 4542
cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
然后重启虚拟机就找到了
可用了
上传了个文件一看确实是/var/ftp文件夹
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
sudo mkdir /var/ftp/123
sudo chmod 777 /var/ftp/123
cc@thinkpad:~$ sudo service vsftpd restart
[sudo] password for cc:
vsftpd stop/waiting
vsftpd start/running, process 4542
cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
然后重启虚拟机就找到了
可用了
上传了个文件一看确实是/var/ftp文件夹多了个文件
sudo chmod 777 /var/ftp/123
cc@thinkpad:~$ sudo service vsftpd restart
[sudo] password for cc:
vsftpd stop/waiting
vsftpd start/running, process 4542
cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
然后重启虚拟机就找到了
可用了
上传了个文件一看确实是/var/ftp文件夹多了个文件
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
可是这两句话还是不懂1.匿名用户就是ftp,想要匿名用户写入,必须文件夹的权限为ftp可写。
2.匿名用户的根目录不允许写,所以根目录的权限绝对不能是ftp可写和其他用户可写,如果根目录所有者为ftp的话,所有者的权限也不能写。
后两句
所以解决方法是建个单独的public文件夹用于上传文件,设置其为ftp可写或”其他用户可写“
还可建个download文件夹只用于下载,设置其他用户没有写权限便可。
倒是懂了 可是代码分别是几呢???
求神解答前两句的意思 和提供后两句的数字代码 人类谢过了
2.匿名用户的根目录不允许写,所以根目录的权限绝对不能是ftp可写和其他用户可写,如果根目录所有者为ftp的话,所有者的权限也不能写。
后两句
所以解决方法是建个单独的public文件夹用于上传文件,设置其为ftp可写或”其他用户可写“
还可建个download文件夹只用于下载,设置其他用户没有写权限便可。
倒是懂了 可是代码分别是几呢???
求神解答前两句的意思 和提供后两句的数字代码 人类谢过了
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
我在之前
anonymous_enable=YES
write_enable=YES
anon_mkdir_write_enable=YES
anon_upload_enable=YES
基础上 增加了
chroot_local_user=YES
按说应该是匿名访问 但只能看到/
可是他怎么就这么奇怪 还能打开123(重启过sftp和虚拟机) cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
矛盾啊!!!
anonymous_enable=YES
write_enable=YES
anon_mkdir_write_enable=YES
anon_upload_enable=YES
基础上 增加了
chroot_local_user=YES
按说应该是匿名访问 但只能看到/
可是他怎么就这么奇怪 还能打开123(重启过sftp和虚拟机) cc@thinkpad:~$ ftp 192.xxx.xxx.xxx
Connected to 192.xxx.xxx.xxx.
220 (vsFTPd 3.0.2)
Name (192.xxx.xxx.xxx:cc): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
矛盾啊!!!
- qy117121
- 论坛版主
- 帖子: 50587
- 注册时间: 2007-12-14 13:40
- 系统: Winbuntu
- 来自: 志虚国乌由市
- 联系:
Re: wiki上的vsftp教程有一点不懂求解释
没用过vsftp
感觉用pure-ftpd简单
感觉用pure-ftpd简单

-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
效果是像这样的。
注:我的本地用户(local user为yeshuai,home directory为/home/yeshuai)
root@ubuntu:~# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.2)
Name (localhost:yeshuai): yeshuai
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp> pwd
'''257 "/"'''
看上边,正常情况下,输入pwd时,应该是显示/home/yeshuai.
由于我做了chroot.所以,/home/yeshuai变成 /
可是我的本地用户cc登录都登录不了 在改之前还行的。。。。。 咋回事
注:我的本地用户(local user为yeshuai,home directory为/home/yeshuai)
root@ubuntu:~# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.2)
Name (localhost:yeshuai): yeshuai
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp> pwd
'''257 "/"'''
看上边,正常情况下,输入pwd时,应该是显示/home/yeshuai.
由于我做了chroot.所以,/home/yeshuai变成 /
可是我的本地用户cc登录都登录不了 在改之前还行的。。。。。 咋回事
- oneleaf
- 论坛管理员
- 帖子: 10455
- 注册时间: 2005-03-27 0:06
- 系统: Ubuntu 12.04
Re: wiki上的vsftp教程有一点不懂求解释
vsftpd 不允许匿名写ftp主目录, 是因为对ftp目录执行过chmod 777。所以使用chmod -R 750改变权限即可。
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
管理员大神 能劳驾您回答下18楼19楼问题吗 谢了oneleaf 写了:vsftpd 不允许匿名写ftp主目录, 是因为对ftp目录执行过chmod 777。所以使用chmod -R 750改变权限即可。
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
777不是最高权限么 难道最高权限是750?
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
cc@thinkpad:~$ ftp 10.198.127.48
Connected to 10.198.127.48.
220 (vsFTPd 3.0.2)
Name (10.198.127.48:cc): cc
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.
ftp>
可是如果我
chmod a-w /home/cc
那么电脑就无法登录桌面了
有没有别的办法不报错 又能让电脑登录??
Connected to 10.198.127.48.
220 (vsFTPd 3.0.2)
Name (10.198.127.48:cc): cc
331 Please specify the password.
Password:
500 OOPS: vsftpd: refusing to run with writable root inside chroot()
Login failed.
ftp>
可是如果我
chmod a-w /home/cc
那么电脑就无法登录桌面了
有没有别的办法不报错 又能让电脑登录??
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
19楼问题仍存在 求解答
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
1、如何自定义ftp载入文件夹位置 不让他用/var/ftp???
2、如何让root(cc)和匿名用户同用一个目录
2、如何让root(cc)和匿名用户同用一个目录
- qy117121
- 论坛版主
- 帖子: 50587
- 注册时间: 2007-12-14 13:40
- 系统: Winbuntu
- 来自: 志虚国乌由市
- 联系:
Re: wiki上的vsftp教程有一点不懂求解释
1 修改ftp用户的家目录位置,那个目录要设置为ftp用户不可写(直接不属于ftp用户就行了)
2 root ? 本地用户?
http://zhidao.baidu.com/question/213542443.html
2 root ? 本地用户?
http://zhidao.baidu.com/question/213542443.html
-
- 帖子: 1038
- 注册时间: 2012-06-09 15:40
Re: wiki上的vsftp教程有一点不懂求解释
我暂时先不改共享位置 先求神们解决18、19楼问题
- qy117121
- 论坛版主
- 帖子: 50587
- 注册时间: 2007-12-14 13:40
- 系统: Winbuntu
- 来自: 志虚国乌由市
- 联系:
Re: wiki上的vsftp教程有一点不懂求解释
楼主是没明白这里的意思吧限制所有
限制登录用户访问其他目录,改之前登录显示的路径比如是 ~ ,改之后则是 /。
效果是像这样的。
注:我的本地用户(local user为yeshuai,home directory为/home/yeshuai)
root@ubuntu:~# ftp localhost
Connected to localhost.
220 (vsFTPd 2.3.2)
Name (localhost:yeshuai): yeshuai
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
ftp> pwd
'''257 "/"'''
看上边,正常情况下,输入pwd时,应该是显示/home/yeshuai.
由于我做了chroot.所以,/home/yeshuai变成 /
代码: 全选
chroot_local_user=YES
这个代码的作用是,你登录后的目录是/home/user1 ,但是客户端以为是/ 这样而已
并不是把你限制在/ (/home/user1 )下面不能访问子文件夹