cc85734
Posts: 7
Joined: Fri Jan 01, 2016 1:08 pm

Can't log in after typing sudo startx in LXterminal [solved]

Fri Jan 01, 2016 1:14 pm

I am fairly new to linux, just letting you know.

I ran the command 'sudo startx' while in lxterminal (i was in the gui, not cli).

It came up with an error (cn't remember it) and it booted into a desktop, but like I had just purchased the pi.

I rebooted, and it didnt boot straight to the desktop, it wanted me to login, which it has never done before. It wanted me to login, but not in the cli, in a gui login screen . Now, when I type in pi and raspberry, it does nothing. When I type in the wrong password, it says incorrect password. I have not changed the password.

Please help me get back into my rpi!

Should i just re-install raspbian?

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Help!

Fri Jan 01, 2016 1:41 pm

You could just reinstall, or you could try this:

Press Ctrl+Alt+F2 to get to a text-console with a login prompt. Log in as "pi" with password "raspberry". You now have a command prompt.

Then type these commands

Code: Select all

sudo chown pi:pi ~/.Xauthority
touch .~/.Xauthority
sudo reboot
and when the Pi has rebooted you should be back to normal.

cc85734
Posts: 7
Joined: Fri Jan 01, 2016 1:08 pm

Re: Help!

Fri Jan 01, 2016 2:10 pm

rpdom wrote:You could just reinstall, or you could try this:

Press Ctrl+Alt+F2 to get to a text-console with a login prompt. Log in as "pi" with password "raspberry". You now have a command prompt.

Then type these commands

Code: Select all

sudo chown pi:pi ~/.Xauthority
touch .~/.Xauthority
sudo reboot
and when the Pi has rebooted you should be back to normal.
I did that but it says login incorrect. But I havent changed it and i did it twice.

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Help!

Fri Jan 01, 2016 2:12 pm

Probably best to reinstall then. Then change the password, just in case.

cc85734
Posts: 7
Joined: Fri Jan 01, 2016 1:08 pm

Re: Help!

Fri Jan 01, 2016 2:19 pm

rpdom wrote:You could just reinstall, or you could try this:

Press Ctrl+Alt+F2 to get to a text-console with a login prompt. Log in as "pi" with password "raspberry". You now have a command prompt.

Then type these commands

Code: Select all

sudo chown pi:pi ~/.Xauthority
touch .~/.Xauthority
sudo reboot
and when the Pi has rebooted you should be back to normal.
Tried again and it worked.

Thanks so much, I had loads of programs and stuff on there, so I really didn't want to re install! Thanks :)

User avatar
davidcoton
Posts: 5028
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK
Contact: Website

Re: Help!

Fri Jan 01, 2016 3:44 pm

Make a backup so you can recover without having to reinstall :D
Signature retired

turismoassociati
Posts: 1
Joined: Wed Nov 16, 2016 10:17 pm

Re: Help!

Fri Nov 18, 2016 12:04 pm

rpdom wrote:You ... could try this:

Press Ctrl+Alt+F2 to get to a text-console with a login prompt. Log in as "pi" with password "raspberry". You now have a command prompt.

Then type these commands

Code: Select all

sudo chown pi:pi ~/.Xauthority
touch .~/.Xauthority
sudo reboot
and when the Pi has rebooted you should be back to normal.
I had the same problem and your solution worked like a charm. Thank you.
NEVER launch in the Terminal

Code: Select all

sudo startX
when you opened the CLI terminal from the GUI!

Return to “Troubleshooting”