如何只可以访问自己的宿主目录和一个指定的文件夹?

hustnzj2 2014-12-01 12:03:09
我搭建了vsftpd,现在已经设置了用户A只能访问宿主目录, 但我想让A可以对指定目录(不在宿主目录中,已经将此目录的所有者设置为用户A)进行文件上传?应该怎么设置啊?谢谢哦。。
现在如果限制了只能访问宿主目录,就不能上传到那个目录中,提示 550 Failed to change diretory错误
如果不限制才能上传。求助!谢谢!
...全文
212 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
hustnzj2 2014-12-02
  • 打赏
  • 举报
回复
引用 5 楼 micropentium6 的回复:
if vsftpd doesn't follow symbolic link or selinux kicked in, try the following: create a directory inside user’s chroot: mkdir /tmp/harddisk/ftp_pvt/user/music mount the folder you want user to access using the bind option: mount --bind /tmp/harddisk/music /tmp/harddisk/ftp_pvt/user/music Now you can properly give access to folders and files located outside of a user’s chroot without compromising security using vsFTPd. Any complaints? https://radu.cotescu.com/vsftpd-and-symbolic-links/
Wah, u are awesome! The perfect solution! Thank you very much!
hustnzj2 2014-12-01
  • 打赏
  • 举报
回复
引用 3 楼 micropentium6 的回复:
[quote=引用 2 楼 hustnzj2 的回复:] system user
bad idea, if it's allowed, why don't u set up scp directly? As for your question, have u tried the symbolic link?[/quote] I have created a soft link to the destination directory in the home directory, but it doesn't work. It still remind me 550 error.
  • 打赏
  • 举报
回复
引用 2 楼 hustnzj2 的回复:
system user
bad idea, if it's allowed, why don't u set up scp directly? As for your question, have u tried the symbolic link?
hustnzj2 2014-12-01
  • 打赏
  • 举报
回复
system user
  • 打赏
  • 举报
回复
do u set up vsftpd with system user or virtual user?
  • 打赏
  • 举报
回复
if vsftpd doesn't follow symbolic link or selinux kicked in, try the following: create a directory inside user’s chroot: mkdir /tmp/harddisk/ftp_pvt/user/music mount the folder you want user to access using the bind option: mount --bind /tmp/harddisk/music /tmp/harddisk/ftp_pvt/user/music Now you can properly give access to folders and files located outside of a user’s chroot without compromising security using vsFTPd. Any complaints? https://radu.cotescu.com/vsftpd-and-symbolic-links/

19,614

社区成员

发帖
与我相关
我的任务
社区描述
系统使用、管理、维护问题。可以是Ubuntu, Fedora, Unix等等
社区管理员
  • 系统维护与使用区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧