Change user Home Directory in CentOS

By default when you create a user using useradd command user's home Directory Created inside /home Directory, But we can Change the user's home Folder any time using usermod command with -d option. For example we have a user called centuser in our CentOS Server
and if we want to change  centuser's Home Directory /opt/centuser We Can Enter Following Command in the Linux Terminal

usermod -d  /opt/centuser centuser

Change user Home Directory CentOS


Also if you want to Move Files and folders in Current Home Folder to New home Folder use -m option 

usermod -m -d  /opt/centuser centuser

Move Files and folders in Current Home Folder to New home Folder

No comments:

Post a Comment