How to rename the home directory?

System info: Fedra 35 Workstation
I just need help renaming the home diretory , thanks.

1 Like

Logout the graphical session, log in a text VT and set the root password:

sudo passwd root

Log in as root, terminate leftover user processes and move the home:

pkill -9 -u username
usermod -m -d /home/newhome username

Is there a easier way to do it , maybe ?

Not really, unless you create another user, grant it administrative privileges, log out and log in as the new user and then rename and move the home of the original user with the same commands.

1 Like

Thought so , thank you for assuring me. I will just have to get to know Fedoras systems environment becasue at the moment I think I might make a mistake if I try to performe the renaming action.

1 Like

And once you do, you’ll have major problems logging in because your home directory no longer exists as such. You’ll need to edit /etc/passwd to tell it where your new /home is, and you’d better make sure you’ve made a backup copy first.

No need, man usermod.

Well, that edits /etc/passwrd doesn’t it? And, it does it in a much safer way than doing it directly. Thanx for the correction!