2

I installed Ubuntu Linux 12.04 a little while ago to try it out and play around with it (hence I have no idea what I'm doing). I tried changing my home directory by editing the /etc/passwd file, however I must have put in a bad value as I can no longer login to my account. Whenever I try it boots me out to the login screen before I can make it to the desktop. The only other account is guest (I hadn't gotten around to disabling it yet), and I can login to that just fine.

Since I know which file I screwed up, I can edit it back to what it was and hopefully login again. However, since this is a system file, it requires sudo access to modify, which I don't have as a guest. Is there any workaround where I can somehow get sudo access as guest so I can edit this file and login as myself again? Obviously I don't intend to leave that ability on guest, that would be silly.

I remember reading somewhere that I could ssh to localhost as a user with sudo privileges, however I keep getting "connection refused". I believe it needs to be installed, and I hadn't gotten to that, and I can't do it now without sudo anyways...

I did install Linux alongside Windows 7, so if there's some way to edit it via Windows, I could do that (though from my understanding Windows can't read the file system).

Hennes
  • 65,804
  • 7
  • 115
  • 169
Doug
  • 161

3 Answers3

2

You can use single user mode or append init=/bin/bash to your boot entry to login to a root shell

justbrowsing
  • 2,709
2

ctrl+alt+F1 and start TTY > login with your account and use sudo privileges

here is one example

IvanS
  • 21
0

You can boot from the live-cd and chroot into your installation and then change the password. Instructions to do so can be found here.

headkase
  • 1,910