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 am a fairly new Ubuntu user. A few days ago I edited my ~/.profile and have spotted a syntax error in it. Now, when I try to log on, it sends me back to the 'greeting screen' after some errors. I do have a guest account, but no other accounts in the admin group. I've been searching for a solution, but found nothing that has worked so far. Here's what I have already tried:

  1. Launching root terminal from recovery mode in GRUB. When I tried to edit my .profile with nano/vi, it said that it was read-only.
  2. Launching dpkg from recovery mode. This gave me an error saying the mount was terminated with status 32.
  3. Booting into single user mode. This gave me the same error as no. 2; mount was terminated with status 32
  4. Logging in with virtual terminal. I pressed ctrl+alt+f2 in greeting screen and logged in, but there was a login loop here too; it would immediately ask for my login again after I logged in.

Any ideas?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

When you log into recovery mode with grub, you'll have to remount / as readwrite, like:

mount -t ext4 /dev/sda1 / -o rw

you should look at the fstab

cat /etc/fstab

to see if you are supposed to use /dev/sdaX or /dev/sdbX or UUID or Device-by-id syntax. where X is the partition of /. After you do get in, I recommend creating a secondary account. Make sure to add it to the additional group "wheel" or "root", but not as the main group. Also, make sure you use visudo to add this user to the "sudoers".

Additionally, you can type

sudo passwd

to unlock your root account to prevent having to go through all this trouble again. Please do not log into your desktop as root.

share|improve this answer
1  
Thank you, worked very well –  user249259 Feb 18 at 23: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.