我需要更新一个ftp用户的主目录。 我可以运行userdel命令,然后重新添加用户而不会丢失用户所连接的目录吗? 还是有另一种方式来更改用户的目录?
我没有使用chroot_list …
谢谢。
你想使用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.