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
  • 5
  • 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. http://hackingdna.com/Description.aspx?ItemHeaderId=0EB8B405-E590-4BFC-8735-3EFE98439054#.U6HmpHVdXQp might help – No Time Jun 18 '14 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 '14 at 19:41

3 Answers3

0

Execute the following command:

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

And then:

sudo chmod +664 /home/USERNAME/OldFiles

Tim
  • 32,861
  • 27
  • 118
  • 178
  • 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 '14 at 19:43
  • Yep, run the command chmod +664 /home/USERNAME/OldFiles – Tim Jun 18 '14 at 19:49
  • Okay I did that but it says the following

    "chmod: invalid mode: 664"

    – Wee Jun 18 '14 at 19:53
  • OK, try that with sudo as it worked for me. – Tim Jun 18 '14 at 20:02
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
  • 11
  • 25
  • 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 '14 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 '14 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 '14 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 '14 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 '14 at 22:41
  • Thanks guys. Im beginning to lose hope here. What saddens me the most is my music collection was in there. – Wee Jun 18 '14 at 22:53
  • @Wee I didn't mean to imply that there was no way to recover your data. The plymouth issue I do not believe is related, however check this out to see if that fixes the plymouth error. If this is fixed, it may be possible for you to use root to reset [original encrypting] account password, decrypt, and fix your issues. – No Time Jun 19 '14 at 22:26
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,194
  • 17
  • 108
  • 164
  • 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 '14 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 '14 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 '14 at 20:28
  • May I ask what happens when you try to login , exactly? – Uriel Fanelli Jun 18 '14 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 '14 at 20:33
  • Plymouth? So it means you can enter your PC with no X, i.e. via SSH? You can try this: enter the machine via SSH (if possible) , or do a cntrl+alt+f1 : it should go in a terminal session, with username and password. if you do that , are you able to login? – Uriel Fanelli Jun 18 '14 at 20:45
  • Yes when I start a terminal session from the login screen I am able to login. – Wee Jun 18 '14 at 20:58
  • Fine. If you are able to see your files, just tar them (or copy them) into /var/tmp (or into a USB key, or external disk) , and then restore the file you saved into the new account. – Uriel Fanelli Jun 18 '14 at 21:13
  • OKay I logged into my old account and listed the folder contents like this.

    ls /home/oldusername/

    However there's only the file called Access your private data desktop and a Read Me.txt containing the following information. THIS DIRECTORY HAS BEEN UNMOUNTED TO PROTECT YOUR DATA.

    From the graphical desktop, click on: "Access Your Private Data"

    or

    From the command line, run: ecryptfs-mount-private

    There is no sign of my actual documents.

    – Wee Jun 18 '14 at 22:21
  • Yes, this means you need to mount the partition you encrypted. So you need to run "ecryptfs-mount-private" to mount it. Then you should be able to see them. – Uriel Fanelli Aug 07 '14 at 09:26