Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
    
If you have a separate root account you can access the files, if you just need to access the data, you can use a liveboot distro and mount your file system (using the liveboot root privileges). There are also password crack/hack tools which can get you into your account from a terminal as well (which you can run from a liveboot) and programs/sites where you can put in a user/password hash and recover your password. Kali/backtrack come to mind as having these tools, which could help. hackingdna.com/… might help –  No Time Jun 18 at 19:19
    
Thanks but a lost password isnt my issue. Its just that for some reason my account will no longer open. The password I'm using is correct and works when changing settings within the new account. –  Wee Jun 18 at 19:41

3 Answers 3

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).

share|improve this answer
    
Okay I tried gksudo nautilus and I can access my old folder from there but I have only two files. One called "Access your private data desktop" the other is a text file that says the directory has been unmounted to protect my data. When I click on the first icon terminal pops open for a brief second then closes up again and nothing happens. –  Wee Jun 18 at 20:17
    
I am not sure if this is another issue or if there are hidden files try pressing Ctrl+h in nautilus to see if there are hidden files. –  No Time Jun 18 at 22:00
    
When I did that a few folders that I assume have to do with the encryption came up. However nothing related to my actual files. –  Wee Jun 18 at 22:18
    
@Wee I didn't see that long chain of comments about the encryption. If you have a Flash Drive (or drive with FAT/FAT32 filesystem) you may be able to remove the encryption by copying the files directly over to it (if it was through a file system encryption). Otherwise you will need to get your old account back and decrypt using the account associated with the encryption. I cannot remember the site and program I have used to do this. I believe it is on Kali. You could use "John the Ripper" to try and crack your password, log in with old account decrypt files, then go to work. –  No Time Jun 18 at 22:40
    
@Wee Just so you are not frustrated with Ubuntu because of this issue, whenever having files encrypted with an associated account (like user ID), and the account is lost, often the files are just lost, unless you go through a somewhat long process. This happens in Windows, and OSX as well. –  No Time Jun 18 at 22:41

Execute the following command:

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

And then:

sudo chmod +664 /home/USERNAME/OldFiles

share|improve this answer
    
Thanks I did this and it created a folder name oldfiles but when I try to access it I get the same "you do not have the necessary permissions" message. The folder icon also has a little lock on it. Any idea how to fix that? –  Wee Jun 18 at 19:43
    
Yep, run the command chmod +664 /home/USERNAME/OldFiles –  Tim Jun 18 at 19:49
    
Okay I did that but it says the following "chmod: invalid mode: 664" –  Wee Jun 18 at 19:53
    
OK, try that with sudo as it worked for me. –  Tim Jun 18 at 20:02

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.
share|improve this answer
    
I did choose to encrypt the old folder when I made the installation. Does that mean I cant access them again? I did save the encryption code somewhere. Does it matter from which account I'm using the sudo passwd non workinguser command? –  Wee Jun 18 at 20:19
    
Then this could be a problem. Until you aren't logged with your account, the trick I mentioned will not work. Being honest, I am afraid until you don't login with your user, no trick will work. I suggest you to try fixing your password resetting it with sudo passwd. –  Uriel Fanelli Jun 18 at 20:22
    
Hi, Ive reset the password and still the same problem occurs. I'd already tried changing the password for the old account through my current account to with no success. No idea why this ended up happening. When I try to log in I can see the following message flashed on screen before I get sent back to the login screen "mountall: Plymouth command failed mountall: Disconnected from Plymouth" –  Wee Jun 18 at 20:28
    
May I ask what happens when you try to login , exactly? –  Uriel Fanelli Jun 18 at 20:31
    
When I type in my password and hit enter the screen goes into terminal and flashes the following messages for a brief second, then it goes back to the login screen. "mountall: Plymouth command failed mountall: Disconnected from Plymouth¨ –  Wee Jun 18 at 20:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.