To change an user home folder to another folder you can use 2 methods

  • usermod -d /mynewfolder/anotherfolder username

Ex: usermod -d /opt/install myuser to change new default home folder of myuser to /opt/install

  • Edit /etc/passwd and change home folder path of the user

Ex: myuser:x:503:503::/home/myuser:/bin/bash

change to

myuser:x:503:503::/opt/install:/bin/bash

2 Responses to “How to change user home folder in Linux”

  1. Matt Says:

    How can you change the default home directory thar “adduser” uses when the –home argument is not sent? Is there a .conf file or something someware?

  2. Website Tasarimi Says:

    Bilgiler”>Linux Bilgiler|<a href="http://www.modagirdim.com"

Leave a Reply