In case like I had – not able to access my account – you need to know how to run sudo commands from Guest account in UBUNTU.
When you need this? Well, I can’t tell you exactly when, but I had situation where I wanted to restore – recover – data from one disk to my primary hard drive and in which case my hard drive get full leaving my system paralyzed.
First to mention that I used ddrescue for restoring data from lost partition and that this software is very good for that purpose. If you ever stuck with lost partition on UBUNTU then I suggest you to try this powerful piece of software.
Anyway, like I said – my system get so slow and unable to do anything after I fill up my hard drive leaving it with 0Bytes of free space.
After restarting my UBUNTU 14.04 and logging in into my account I noticed that OS can’t load my profile. Probably because there is no free space for that account on my hard drive.
Searching the internet I found that I could run some commands with permissions I need even from Guest account. I’m talking about Default UBUNTU Guest account.
How to do that? How exactly I can run sudo commands while I’m running UBUNTU in Guest account?
Go to Guest account and while you are logged use this key combination
which will start TTY where you will be prompted to log in. There you choose Username with privileges and type a password – confirm with enter and viola. You can now execute commands with sudo privileges.
In my case I needed command to delete this large image.img file I got while using ddrescue. Hard drive I was restoring is a much more larger than the one where image file was created. My mistake I admit.
Solution for my problem – to log in back to my profile and start using it – was to delete file image.img
Here is procedure
From TTY I logged into my account and run command
sudo rm -rf /media/image.img
After that I restarted Computer and logged into my original account without any problems.