0

I created a new user, granted admin rights to it and deleted my old user account.

Now I don't have access to deleted user's files and all that data.

I would like to replace the new user's home folder with that deleted old user's home folder which I now have to open by opening /home/old_user/

When I try to open the old user's files the following message is displaying:

You do not have the permissions necessary to view the contents of this folder

I am not getting why I can't get access to my files as I am the only user of this laptop and I have granted administrator permissions to this account too.

6
  • because they belong to the old user not the new user
    – ravery
    Oct 7, 2017 at 10:16
  • I myself was the old user jeez.I just switched my user account and deleted the old one that's all. @ravery
    – XoXo
    Oct 7, 2017 at 10:24
  • 1
    you are now a new user, the computer doesn't know who is sitting at the keyboard, it only know which account is logged in, and the new account doesn't own the files
    – ravery
    Oct 7, 2017 at 10:26
  • Okay.Now help me by giving a solution to this trouble.
    – XoXo
    Oct 7, 2017 at 10:28
  • 1
    what do you want to do? move them? just be able to open them ?? delete them? all of the above?
    – ravery
    Oct 7, 2017 at 10:33

1 Answer 1

2

If you do have the root password and the current user is in sudoers group, you just have to chown recursively your /home/old_user/, something like :

sudo chown -R new_user:new_group /home/old_user/

In this case you should get the same permission as you had before. If you want to change them, use chmod with the appropriate code.

3
  • new _group? Am i suppose to a create a new group or what? Btw i didn't understand this part of your answer ...and the current user is in sudoers group.Can you be a little more specific?@Renon
    – XoXo
    Oct 7, 2017 at 11:06
  • When creating a new user, a new group of the same name is created with the new user in it, so if your new user is "pineapple", you just run sudo chown -R pineapple:pineapple /home/old_user/ if you want this group to have permissions on this folder. If you can use sudo, you are in the sudoers group.
    – Renon Lift
    Oct 7, 2017 at 11:32
  • This answer is helpful, but OP also mentions that they want to replace the new home directory with the old home directory (which can be a bit tricky in terms of configuration, and might have some unintended effects).
    – Zanna
    Oct 17, 2017 at 4:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .