Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 8 down vote accepted

You want to use the usermod command. You are going to want to use the -m and -d directives to modify their home directory.

-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.
share|improve this answer
    
Thanks, that worked perfectly! –  Spencer Aug 15 '11 at 19:15

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.