how can I change the home directory of a user

0

I just changed the username of an existing user by doing:

usermod -l new_username old_username

and now I wanted to change the home directory using the following:

 chown -R root.new_username .bash* .profile /home/new_username

however it always gives me:

 chown: invalid user: `root.newuser'

What is wrong?

adit

Posted 2014-06-27T14:08:50.970

Reputation: 101

Something is wrong what you are doing and I don't get it why you want to change root user files owner.

Do you trying to rename the root user folder and owner of the files.

whay is the connection between root, old_user and new_user? – Sencer H. – 2014-06-27T14:25:53.373

I thing your answer is here: http://askubuntu.com/questions/34074/how-do-i-change-my-username

– Sencer H. – 2014-06-27T14:39:58.223

Answers

1

Replace root.new_user with root:new_user

Matthew Williams

Posted 2014-06-27T14:08:50.970

Reputation: 4 149

Some OSes (like Ubuntu) accepts both '.' (dot) and ':' (colon). – Sencer H. – 2014-06-27T14:21:10.590

nope, didn't work as well, chown: invalid group: `root:new_user' – adit – 2014-06-27T14:21:10.540

yea, but it didn't work – adit – 2014-06-27T14:26:34.440

@adit | You might want to double check your user has actually changed. If it shows your new_user maybe a system restart might be useful. – Matthew Williams – 2014-06-27T14:27:12.910