V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dunhanson
V2EX  ›  程序员

RockyLinux vsftpd 虚拟用户问题

  •  
  •   dunhanson · 2022-11-23 14:37:28 +08:00 · 924 次点击
    这是一个创建于 513 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Secure FTP Server - vsftpd - Documentation (rockylinux.org)

    我是参照 RockyLinux 官方的教程进行安装的,连接没问题,但是上传不了文件

    我尝试了修改目录的用户和用户组,就可以上传了

    但是重启 vsftpd 服务后,就连接不上了

    chown vsftpd.nogroup /var/www/sub-domains/com.testdomain/html
    

    想要的效果:不同的用户对同一个目录有不同的权限,比如 a 用户可以上传和下载,b 用户只能下载

    第 1 条附言  ·  2022-11-23 15:11:03 +08:00
    533 could not create file
    11 条回复    2022-11-26 11:20:01 +08:00
    ikidou
        1
    ikidou  
       2022-11-23 20:16:41 +08:00
    虚拟用户是不是一定得用 PAM ?我就想一个人用,感觉搞复杂了,后面还是自己用 SFTP 和 SCP 了
    feng0vx
        2
    feng0vx  
       2022-11-23 21:11:36 +08:00 via iPhone
    https://blog.csdn.net/lovefengchenlove/article/details/112394461
    楼主看我以前的笔记,部署过好几次了
    xshell
        3
    xshell  
       2022-11-24 13:47:42 +08:00
    CentOS6.x 下编译安装 vsftpd-3.0.3
    https://www.dba.kim/Linux/centos-install-vsftpd-3-0-3.html

    几年前安装的,现在还有人用 ftp···
    dunhanson
        4
    dunhanson  
    OP
       2022-11-24 23:07:36 +08:00
    @ikidou 没办法一开始就搭建的 FTP ,已经接入了一些程序
    dunhanson
        5
    dunhanson  
    OP
       2022-11-24 23:08:01 +08:00
    @feng0vx 我看下,谢谢
    dunhanson
        6
    dunhanson  
    OP
       2022-11-24 23:08:37 +08:00
    @xshell 哈哈 没办法,
    dunhanson
        7
    dunhanson  
    OP
       2022-11-25 09:27:05 +08:00
    @ikidou @feng0vx @xshell 最新版本的 vsftpd 不允许根目录有写入权限?感觉有点坑
    xshell
        8
    xshell  
       2022-11-25 14:41:16 +08:00
    allow_writeable_chroot=YES
    加下配置文件
    feng0vx
        9
    feng0vx  
       2022-11-25 20:14:10 +08:00 via iPhone
    @dunhanson 是的,我放在别的目录了,别的目录 own 也不能是 ftp 用户,无奈用了 root 创建,权限 777 ,或者试下楼上的方法
    feng0vx
        10
    feng0vx  
       2022-11-25 20:15:20 +08:00 via iPhone
    @dunhanson 不是根目录,是 ftp 用户的家目录默认不能作为服务目录
    dunhanson
        11
    dunhanson  
    OP
       2022-11-26 11:20:01 +08:00
    @xshell @feng0vx 对,用这个配置可以了 allow_writeable_chroot=YES
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   912 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 22:10 · PVG 06:10 · LAX 15:10 · JFK 18:10
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.