2

I can no longer log into my account even having the correct password. I tried all the suggested advice on the site with no success. I also posted a question and am waiting for a reply. While I fix that issue however, I really need to access my files for work.

I created a new account which is what I'm using now and when I try to access my old account's files it says I cant as I'm not the owner. I'd be happy being able to transfer my files from my old account onto this new one but I'm unsure as to how I could do that.

Is there a way I could change the permissions on my previous account's folder so that I can access and transfer my files onto my new account? When I click on properties on that folder all the settings are blurred out and I cant change anything. I assume the only way to do it is through terminal.

Can someone please guide me on how to do this? I'm not super skilled at using terminal but I do have a little bit of experience with it. I would really appreciate any help you could offer me.

Thank you.

Wee
  • 21

3 Answers3

0

Execute the following command:

sudo cp -R /home/OLDUSERNAME /home/MYNEWUSERNAME/OldFiles

And then:

sudo chmod +664 /home/USERNAME/OldFiles

Tim
  • 33,500
0

Comment would be too long.

You just need to do whatever you are wishing to do with elevated privileges (as Tim mentioned)


  • sudo (temporarily gain superuser/root privileges)
  • su (grant superuser/root privileges until program/task ends)
  • gksudo(think sudo for graphical programs).

From terminal you can do something like: gksudo nautilus

This will run Nautilus (default file manager) with elevated privileges.

You should be able to mess with your permissions (graphically) from there.

You could also change the permissions from the terminal (on your files now copied from Tim's post) So assuming the new directory is /home/MYNEWUSERNAME/OldFiles and your user name is MYUSERNAME.

chown -hR MYUSERNAME /home/MYNEWUSERNAME/OldFiles

This should change the owner of the files (and all sub directories and files within) to your user account (letting you use the files).

No Time
  • 1,073
0

So, you have two problems.

First, you could try to fix your password

sudo passwd *nonworkinguser

which is the single-shot solution.

if you want to migrate your home from one user to another, just create an user, then

sudo mv /home/newuser /home/newuser.bak
sudo mv /home/olduser /home/newuser
sudo chown -R newuser.newuser /home/newuser

doing that you just moved your home from one user to another, then you changed the rights to all the files: you need this to have them owned by the new user.

Of course we are assuming that:

  • Your home folder is still intact (maybe this is the reason you can't login?)
  • Your old files are still available (i.e no encryption)
  • Your problem logging is not "disk 100% full" or similar.
Wilf
  • 30,732