VSFTPD - 更改用户主目录

Spe*_*cer 5 centos ftp chroot vsftpd

我需要更新 ftp 用户的主目录。我可以运行userdel命令然后重新添加用户而不丢失用户附加的目录吗?或者是否有另一种方法来更改用户的目录?

我也没有使用 chroot_list ......

谢谢。

Zyp*_*her 10

您要使用该usermod命令。您将要使用-m-d指令来修改其主目录并移动其内容:

  -d, --home HOME_DIR
       The users new login directory.

       If the -m option is given, the contents of the current home
       directory will be moved to the new home directory, which is created
       if it does not already exist.

  -m, --move-home
       Move the content of the users home directory to the new location.

       This option is only valid in combination with the -d (or --home)
       option.
Run Code Online (Sandbox Code Playgroud)