5

I need to update a ftp user's home directory. Could I run the userdel command then re-add the user without losing the directory the user was attached to? Or is there another way to change the user's directory?

I'm not using a chroot_list either...

Thanks.

Castaglia
  • 3,349
  • 3
  • 21
  • 42
Spencer
  • 213
  • 3
  • 5

1 Answers1

10

You want to use the usermod command. You're going to want to use the -m and -d directives to modify their home directory and move its contents:

  -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.
Owen Blacker
  • 631
  • 1
  • 8
  • 20
Zypher
  • 37,405
  • 5
  • 53
  • 95