我需要更新 ftp 用户的主目录。我可以运行命令userdel
然后重新添加用户而不丢失用户所附加的目录吗?或者还有其他方法可以更改用户的目录吗?
我也没有使用 chroot_list......
谢谢。
答案1
您要使用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.