I am reading a book about Linux. It says that one of the ways (although not the best - I am aware that this can also be done with usermod
) to change the home directory of a user is to change the home directory in /etc/passwd
for that particular user. I have successfully changed the entry for a particular user to
mainuser:x:1000:1000:mainuser:/home/mainuser/projects:/bin/bash
However, upon logging into a shell as this user, I am positioned in /home/mainuser
directory and not /home/mainuser/projects
. Am I misunderstanding what home directory means? Shouldn't I be in /home/mainuser/projects
when I log in?
Additional info:
Running Linux Fedora 25
grep mainuser /etc/passwd
mainuser:x:1000:1000:mainuser:/home/mainuser/projects:/bin/bash
$ getent passwd mainuser
mainuser:x:1000:1000:mainuser:/home/mainuser/projects:/bin/bash
getent passwd mainuser
,ls -l /home/mainuser/projects
, and the exact comand how you login with that user and its output.