User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Unable to Login Anymore

Tue Jan 01, 2013 8:28 pm

Yesterday I setup my RPi to use SSH and then VNC. Both work great. I can login and out just fine. But this morning I realized I have a login screen on my RPi after booting it and trying to use it directly from the connected monitor, keyboard & mouse. Before setting up SSH & VNC, it didn't even come up with a login. It went straight into the LXDE desktop.

This new little login screen says raspberrypi and asks for a login. I put in 'pi' and then it asks for password. I put in 'raspberry' and it then blanks the monitor, does something and then comes back again asking for logon. I don't think it's because it doesn't like the login & password I gave, because if I enter something off the wall, it says it's a bad password.

This new login screen also has choices for Default Xsession, LXDE and Openbox. I've tried all three to no avail. I've also tried the 8 character password I used for VNC. I've killed vncserver and closed puTTY remotely.

I really can't do anything from the directly connected desktop, except restart or shutdown. I was planning on using the RPi mostly remotely anyway, but I really want to find out why I can no longer get into it directly. I'm fairly new to Linux. The solution is no doubt going to be something simple.
http://allenmlab.blogspot.com/

rgh
Posts: 211
Joined: Fri Nov 25, 2011 3:53 pm

Re: Unable to Login Anymore

Tue Jan 01, 2013 10:44 pm

Can you do Ctrl-Alt-F1 (or F2, F3, etc) and get a text login screen? Try logging in there and see (a) if it works and (b) if not, whether you get helpful error messages. The sort of problem you are seeing can occur if there is some problem with the scripts that run on login, they return an error and kill the login session. Trying on a text login screen might show a bit more info.

It's not clear from from your post whether you can still log in via ssh today; can you? If so, then whatever username/password you use with ssh are when you should use to login in on the local keyboard and screen.

On first boot up of a new SD card image you don't get a login screen, it goes straight in to the config utility instead. On subsequent reboots you do get the login screen.

User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Re: Unable to Login Anymore

Tue Jan 01, 2013 10:53 pm

Update - I ran raspi-config remotely on my RPi and turned the 'start desktop on boot" option off. Now when it boots up it comes to a console type login & password, which accepts pi and raspberry. From there I run "startx" which opens a normal gui desktop - not the same one with my program icons I had before setting up SSH & VNC, but at least I have a desktop.

If I turn the option back on to start a desktop on boot, I still get the new little login window that won't accept my user id or password. So, I still have no idea what that's about.
http://allenmlab.blogspot.com/

User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Re: Unable to Login Anymore

Tue Jan 01, 2013 11:07 pm

rgh - yes, I can still login ok from SSH with my normal default ID & Password. But this new little login screen I get booting locally won't accept that ID & Password.

I did try Cntl Alt F1 and it does go to the console login, which does accept my normal ID & Password. I didn't see anything unusual (to me... ) on the console screen. From there I can do a startx to open a desktop. I'm still confused by that new little login screen, though, that won't accept my ID & Password.
And, of course, I can't get my desktop back with my program icons.
http://allenmlab.blogspot.com/

rgh
Posts: 211
Joined: Fri Nov 25, 2011 3:53 pm

Re: Unable to Login Anymore

Tue Jan 01, 2013 11:37 pm

You could try logging in on the local desktop, then once that has failed, log in via ssh and look for files such as

/var/log/Xorg.0.log
$HOME/.xsession-errors

Maybe one of those will have some clues - not certain those exact files will exist - the do on my Ubuntu netbook - but look around for anything similar. e.g. any recently changed files in /var/log or your home directory might be interesting (try "ls -lrt /var/log" and "ls -lrta $HOME", for example to sort most recently changed files last). Note those two files often have scary looking entries that are not really a problem, so some guesswork may be required.

User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Re: Unable to Login Anymore

Wed Jan 02, 2013 12:50 am

ok - I did find the Xorg.0.log file, also Xorg.1.log and Xorg.2.log files, plus some others labeled old. They do have some interesting entries. It's going to take me awhile to study them. What do 0, 1 & 2 stand for in the file name - desktops? With so many log files in that directory, why did you suggest these particular ones? Do they keep track of what's happening in the X desktop as it boots?

Thanks!
http://allenmlab.blogspot.com/

rgh
Posts: 211
Joined: Fri Nov 25, 2011 3:53 pm

Re: Unable to Login Anymore

Wed Jan 02, 2013 10:13 am

Yes, I think the 0, 1, 2 refer to different desktops; probably the 1 and 2 come from your VNC sessions (or maybe 0 is whichever you try first, 1 is used if you try another before the first terminates, etc... not sure - timestamps on the files might help narrow it down). They track what happens as the X server starts up. I mentioned these file in particular because they were the only ones I could think of that might log stuff related to a user session startup, as opposed to general system-wide events. Good luck :)

User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Re: Unable to Login Anymore

Thu Jan 03, 2013 10:07 pm

Not finding anything in the logs helpful to a Linux noob like me, I decided to reflash my SD card and start over. This time I documented each setup step, looking for the point at which I could no longer login to the RPi desktop. Everything went like clockwork, nothing funky happened until I installed and started tightvncserver. Even that seemed to go ok and I was able to log in and out of vnc viewer on my Windows computer. But from that point forward, I can't login into my RPi desktop. I get the little window type login screen that keeps bouncing back in a few seconds and again asks for my user id and password. I'm pretty sure it accepts my user id and password, because if I put something else in, it says incorrect password right away. It's like it goes out and checks something, doesn't like what it finds and comes back to login.

If I do a Ctrl Alt F1, I go to a console login that accepts my user id and password. Then I can do a sudo startx and bring up a gui desktop. So, if that works, what's the big deal you say? Well, I'm not comfortable with the idea that it won't let me login from that first login window. Somethings not quite right and setting up vncserver definitely caused it. I am killing vncserver. Is there possible something else I should be doing at either the client or server end when done using vncserver?
http://allenmlab.blogspot.com/

User avatar
moallen
Posts: 36
Joined: Fri Dec 28, 2012 6:37 pm
Contact: Website

Re: Unable to Login Anymore

Fri Jan 04, 2013 3:12 am

Just a final note - I decided to reflash my SD again and try a different vnc server. This time I installed x11vnc instead of tightvncserver and all is good. No more problems with a wierd login screen. I might say I did finally realize the wierd login screen wanted 'root' as the user, but I didn't have a password associated with 'root'. So I set a password for root, and then I was able to login to that strange desktop login. The question is why does installing tightvncserver cause a regular boot to the RPi desktop to want a password when it didn't prior to installing vncserver? I guess it has something to do with the RPi getting locked into a root user mode. I'm sure an experienced Linux person would've resolved the issue in less than a minute, but I'm happier with the way x11vnc works anyway.
http://allenmlab.blogspot.com/

marcolepsy
Posts: 3
Joined: Tue Jan 22, 2013 7:29 pm

Re: Unable to Login Anymore

Tue Jan 22, 2013 7:33 pm

I'm experiencing the same issue, seemingly under the same circumstances (after installing tightvncserver). I'm not an experienced Linux user myself and can't figure out what's up. Would like to use tightvncserver also, not x11vnc. Any tips on leads for what to look at?

michaelpgc
Posts: 1
Joined: Sat Feb 02, 2013 12:33 am

Re: Unable to Login Anymore

Sat Feb 02, 2013 12:49 am

I think I may have a fix that doesn't require a card reflash. Please bear with me, I'm new to linux.

I installed TightVnc and set it up to auto start (which I never got working satisfactorily), then on reboot started getting the login screen that would only accept Root (once activated). SSH still worked and I could login as pi.

I've since removed TightVnc to try to help and removed all the autostart changes I made. Still getting the same login screen.

Here's the fix that got me back to booting straight into Lxde as user Pi with no login screen:

1. Boot your R-Pi

2. SSH log in with your user account (normally user: pi, password: raspberry)

3 Enter your home directory by typing

Code: Select all

cd ~
4. Type

Code: Select all

ls -A
5. You will now see which files are in your home directory. Look if you see a file called .Xauthority

6. Type

Code: Select all

mv .Xauthority .Xauthority.backup
7. Type

Code: Select all

sudo chmod 777 /home/pi
8. Type

Code: Select all

sudo reboot
That did the trick for me, let me know if it works for you.
I think I'll have a go with x11vnc and see if that's better.

Source: http://www.raspberrypi.org/phpBB3/viewt ... 72&p=74805

marcolepsy
Posts: 3
Joined: Tue Jan 22, 2013 7:29 pm

Re: Unable to Login Anymore

Sat Feb 02, 2013 10:14 pm

Thanks for the excellent insight! I don't think that you have to chmod all of the files in the home directory to allow everything for everyone, as you did. For me, I just changed the owner of .Xauthority to the 'pi' user, and it booted back into the GUI without a login screen.

Paul_griff
Posts: 45
Joined: Sat Jul 21, 2012 9:23 pm

Re: Unable to Login Anymore

Thu Mar 14, 2013 7:57 pm

Michaelpgc - your method works perfectly, I have had this problem before and had to reflash my sd card then go through the process of reloading everything and setting up as It was before. But thanks to this method I have avoided that and my pi is working as it did before. I posted this problem in the forum before Christmas but did not get a single reply, so well done to you, and a word of warning to anyone reading this, avoid at all costs the little red power icon in the bottom right of your screen! In my experience it is nothing but trouble.
Apologies for all the stupid questions!

Paul_griff
Posts: 45
Joined: Sat Jul 21, 2012 9:23 pm

Re: Unable to Login Anymore

Thu Mar 14, 2013 8:01 pm

Just to elaborate, my problem was nothing to do with tight vnc, it was caused by me doing a restart by the red power icon in the bottom right of the screen. This may have something to do with me being automatically logged in as a superuser, not sure, but my advise would be to reboot use "sudo reboot" or to power down just pull the plug!
Apologies for all the stupid questions!

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Unable to Login Anymore

Fri Mar 15, 2013 10:04 am

Paul_griff wrote:... my advise would be to reboot use "sudo reboot" or to power down just pull the plug!
Don't ever just pull the plug, you are risking a corrupted file system if the power goes off when the Pi is trying to write anything to any files (including the logs). If you have command line access, issue the "poweroff" command, better to issue "sync;poweroff" to insure having written whatever needs writing to disk before pull the plug, and if you absolutely have to pull the plug, be sure to do it when the ACT light is off. If ACT is red, never, ever just pull the plug when ACT light is on.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

wadebarry
Posts: 1
Joined: Sun Mar 17, 2013 5:50 pm

Re: Unable to Login Anymore

Sun Mar 17, 2013 5:53 pm

Guys, many thanks for this thread. I have been banging my head on this issue. All now fixed.

Paul_griff
Posts: 45
Joined: Sat Jul 21, 2012 9:23 pm

Re: Unable to Login Anymore

Sun Mar 24, 2013 12:58 pm

I think this problem arises when the password has not been set/changed, even if you just go through the process and set it as the default "raspberry" using either the initial raspi-config change password line or the su passwd command.
Apologies for all the stupid questions!

Sheeenn
Posts: 1
Joined: Fri Mar 29, 2013 1:43 am

Re: Unable to Login Anymore

Fri Mar 29, 2013 1:48 am

This is a problem. i Enabled the boot on startup to gui option, and then turned it off after future thought. i am very new to linux. after disabling the option, it asked me to restart. i have now been locked out. it wont accept my login (pi-raspberry) and it just says login incorrect. every time. i never changed my password or anything of the like. anyone have a answer? is there a way to access the command line without logging in? how would i do that? can i fix this without re-flashing my sd card?

brannonsweet
Posts: 1
Joined: Tue Jan 14, 2014 12:27 am

Re: Unable to Login Anymore

Tue Jan 14, 2014 12:33 am

Wow. I came to this forum and found your post. I have the exact same problem. I started reading your post and actually thought to myself, "Did I already post my issue on this forum?" Well I have no solution yet, but will keep an eye on the replies here as I'm sure whatever fixes you, will fix me as well.

maser228
Posts: 1
Joined: Thu Jan 30, 2014 9:57 pm

Re: Unable to Login Anymore

Thu Jan 30, 2014 10:01 pm

I'll second the "rename .Xauthority" fix. Didn't need to chmod anything or uninstall tightVNC (though I haven't run it since either), and now I'm booting again as before. Kudos for the solution!

So has anyone determined whether tightVNC will always hose the login, or is there a workaround (other than not using tightVNC)?

sicklittlemonkey
Posts: 2
Joined: Sun Jul 13, 2014 5:33 am

Re: Unable to Login Anymore

Sun Jul 13, 2014 5:42 am

Thanks, this was my problem too. I used:

Code: Select all

chown pi:pi .Xauthority
Cheers,
Nick.

oherrmann
Posts: 3
Joined: Sat Jul 19, 2014 11:34 pm
Location: Massachusetts, US

Re: Unable to Login Anymore

Sat Jul 19, 2014 11:42 pm

I had the same issue and since when the script that was starting tightvncserver was called when root was the user, I changed the line in /etc/rc.local to this:

sudo -u pi /usr/bin/tightvncserver

and now when I connect I have icons on my screen and I am logged in as the user pi... obviously you could change the user after -u to whatever you wanted... :D

User avatar
DougieLawson
Posts: 35519
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Unable to Login Anymore

Mon Jul 21, 2014 2:29 pm

Wouldn't it be better to remove it from /etc/rc.local and add a line to user pi's crontab?

crontab -e

Code: Select all

@reboot /usr/bin/tightvncserver
Note: Having anything remotely humorous in your signature is completely banned on this forum. Wear a tinfoil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

oherrmann
Posts: 3
Joined: Sat Jul 19, 2014 11:34 pm
Location: Massachusetts, US

Re: Unable to Login Anymore

Wed Jul 23, 2014 1:58 am

Does crontab have a syntax for starting a service when the server boots? I'm not that familiar with it.

oherrmann
Posts: 3
Joined: Sat Jul 19, 2014 11:34 pm
Location: Massachusetts, US

Re: Unable to Login Anymore

Wed Jul 23, 2014 1:59 am

Nevermind, you list it there, don't you? :oops:

Return to “Troubleshooting”