Ubuntu won't let me log in

Asked by Endolith

For the last few days, I have had trouble logging in. This time, the computer is in screensaver mode, with a locked screen. I enter my password and it does nothing for a few minutes, and then says login timed out. I go to TTY1 and enter my username and password, it shows the introductory screen, then hangs. I go to TTY2 and enter a different username and password, it does nothing for 60 seconds, then times out. During this time, it responds to pings but SSH does nothing.

After a while of this, it changes to a completely black screen and doesn't respond to anything, even Ctrl+Alt+F4 or Ctrl+Alt+Backspace,

After doing Alt SysReq R S E, it becomes responsive again.

Why do things like this happen? How am I supposed to diagnose a system I can't even log into? Why doesn't TTY1 have much higher priority than whatever is running in the graphical session?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Sam_ (and-sam) said :
#1

>How am I supposed to diagnose a system I can't even log into?

How about recovery mode (root shell) and examine from there?
Hope this helps.
https://answers.launchpad.net/ubuntu/+question/11873

Another option: LiveCD

http://www.ubuntu.com/getubuntu/releasenotes/904
Quote:
Ctrl-Alt-Backspace disabled by default in Xorg
The Ctrl-Alt-Backspace key combination to force a restart of X is now disabled by default, to eliminate the problem of accidentally triggering the key combination. Users who do want this function can enable it in their xorg.conf, or by running the command dontzap --disable.

or try: Alt+SysRq+K

CTRL+ALT+F1 (session)
CTRL+ALT+F2 to F6 (free tty)
CTRL+ALT+F7 (GUI)
CTRL+ALT+F8 (control)

Revision history for this message
Endolith (endolith) said :
#2

recovery mode and livecd can't help if i'm logged in as a normal user maybe the other sysrq keys would be helpful

Revision history for this message
Sam_ (and-sam) said :
#3

Endolith,
please clarify
>recovery mode and livecd can't help if i'm logged in as a normal user

because the issue you described said
>I have had trouble logging in
>diagnose a system I can't even log into

Case #1
User can read logfiles
system administration -> log files
e.g. auth.log
https://help.ubuntu.com/community/LinuxLogFiles

Case #2
Recovery Mode offers e.g. to fix Xserver, root shell e.g. examination, retrieve password
LiveCD offers e.g. reading log files, retrieve password
https://help.ubuntu.com/community/LiveCdRecovery

Reference:
https://help.ubuntu.com/community/FilePermissions
https://help.ubuntu.com/community/UsingTheTerminal
https://wiki.ubuntu.com/X/Troubleshooting/
https://help.ubuntu.com/community/Sudoers

Revision history for this message
Endolith (endolith) said :
#4

I mean that the system runs fine normally. I'm using it right now. But after it goes to screensaver sometimes, something happens that prevents me from logging in. I can't diagnose it since I can't log in.

Revision history for this message
Endolith (endolith) said :
#5

For instance, I just tried to use a command with sudo, and it does nothing after entering my password. I opened TTY1 and sure enough, that hangs after the password, too. I logged into a remote machine with SSH, and tried to log back into this one with SSH, and that hangs, too. How do I figure out what's going on? If the screensaver lock screen comes up, I'll be locked out from that, too.

Revision history for this message
Endolith (endolith) said :
#6

For instance, I just tried to use a command with sudo, and it does nothing after entering my password. I opened TTY1 and sure enough, that hangs after the password and introduction screen, too. I logged into a remote machine with SSH, and tried to log back into this one with SSH, and that hangs, too. How do I figure out what's going on? If the screensaver lock screen comes up, I'll be locked out from that, too.

Revision history for this message
Sam_ (and-sam) said :
#7

Ok, thanks for the clarification.
Could be this one:
https://bugs.launchpad.net/ubuntu/+source/gnome-screensaver/+bug/227994

They need information.
Diagnose:
Start screensaver in debug mode and create a file in /home/user:
gnome-screensaver --no-daemon --debug > screensaver.debug.txt

Something relevant in the log files?
grep -i error /var/log/auth.log
grep -i fail /var/log/auth.log

Options:
Check settings of screensaver and power management.
Please also check in gconf-editor
/apps/gnome-power-manager
e.g. section 'general' and 'lock'.

Check if sudoers is correct, example file is here:
https://help.ubuntu.com/community/Sudoers

Check if you are in relevant groups:
groups username
##output e.g.
username adm dialout fax cdrom floppy tape audio dip video plugdev lpadmin scanner admin

Possible to change the password via Recovery Mode?
Same issue when creating another user?

add:
https://wiki.ubuntu.com/UbuntuBugDay/20080327#GNOME%20Screensaver

Revision history for this message
Endolith (endolith) said :
#8

Normally I can login and use sudo fine. Something happens during a session that causes it to stop working, some process is preventing it from working, I guess, since Alt+SysRq+E fixes it. Last night when I noticed it and I was still logged in, I tried killing lots of processes to see if any freed the login process, but nothing did. I switched back to the first virtual console a few times to check, and then I was going to log out of the graphical session to see if that fixed it, but before I could do that, I switched back to Ctrl+Alt+F1, then back to Ctrl+Alt+F7 and it became black and unresponsive, and I could no longer use Ctrl+Alt+#. The Alt+SysRq keys still work, and again, doing E kills whatever is preventing me from logging in, but it also kills everything else.

Revision history for this message
Sam_ (and-sam) said :
#9

To lookup processes from tty and direct it to a file:
pstree -ln > pstree-output

##in case make a diff
man pstree
man diff

Revision history for this message
Endolith (endolith) said :
#10

How do I enter a command if I can't log in to a terminal?

Revision history for this message
Endolith (endolith) said :
#11

This time I tried Alt-SysRq-K, which didn't do anything. Then I pressed Alt-SysRq-F multiple times until it accepted the login. After pressing it repeatedly, it killed avahi-daemon, then the shell appeared, and then it said stopping anacron. So I'm not sure which of those it is, but one of them seems to be the culprit.

Revision history for this message
Sam_ (and-sam) said :
#12

I understood sudo works sometimes, but never mind, no respond about log files, LiveCD ...
https://wiki.ubuntu.com/DebuggingProcedures
https://wiki.ubuntu.com/Valgrind

Can you help with this problem?

Provide an answer of your own, or ask Endolith for more information if necessary.

To post a message you must log in.