35

After I log in to my user account on Ubuntu 13.04, I get automatically logged out after 1 second of black screen. This happens only with 1 specific user, and I can log in to another account fine.

What could have gone wrong? In which log files should I find my answer?

I installed a VNC server and turned on desktop sharing, and last time I could log in - maybe that is an issue. How can I disable it without GUI?

ckhatton
  • 630
  • 1
  • 6
  • 17
wajs
  • 451

10 Answers10

26

I don't know if it would be exactly the same case, but this happened to me because somehow I corrupted the .Xautority file in my home. I think it's something related with remote access to the X server.

Log into a tty (Control+Alt+F6) and after typing your username and password:

sudo rm -v .Xauthority

The .Xauthority file is in /home/, which is where the terminal's default working path also usually is. If you use a tty to sign in as one user to delete another's .Xauthority file, make sure you've cd'd to the right directory first.

Then restart lightdm with:

sudo service lightdm restart

The sistem will recreate the .Xautority file.

7

For me the immediately logout problem was caused by an error in ~/.profile. I am using 13.10. The (approximate) solution is found here or here. You can change or delete the file causing problems by pressing ctrl + alt + F6 and logging in that way.

Mark
  • 293
3

I had this problem today, after entering the user password, it accepts it and appears to log in, but after a second it returns to login screen.

My root partition was out of space.

I clicked Control+Alt+F6 to get a command prompt and login from there, ran df -h and it shown / root partition was 100% used, I deleted some files from Downloads folder, rebooted the computer, then I was able to login.

adrianTNT
  • 233
3

What worked for me was reestablishing owner and group of the user's home directory.

In recovery mode (or CTRL+ALT+F6 at the login window):

sudo chown -R youruser:yourgroup /home/youruser

In many cases yourgroup = youruser.

(CTRL+ALT+F7 -> back to login window)

2

I had the exact same problem and this was fixed by deleting the newly made ~/.pam_environment file that I had made to modify my Path variable. I logged in to a tty via Ctrl+Alt+F6 to delete the file since I could not log in the regular way.

David Foerster
  • 36,890
  • 56
  • 97
  • 151
1

Reinstall unity, by using the following commands:

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install unity
v2r
  • 9,707
0

I had a similar problem and couldn't even log in using tty. I edited ~/.profile before a reboot and knew that was probably causing an error.

Take your Live USB an boot from it. Then you can just mount your home partition:

sudo mount /dev/sdXY /mnt

now you can navigate to your home directory:

cd /mnt/username/home

and from there you can edit whatever file is causing a problem.

cheshire
  • 283
0

/bin and /sbin removed from $PATH will cause this issue. To fix:

Control+Alt+F6 login /bin/sudo /bin/vim /etc/environment insert PATH="/bin:/sbin" save and exit vim /sbin/shutdown -r now you should now be able to login normally.

0

I had this problem with 14.04 upgrading from 12.04. I fixed it by Alt+Ctrl+F1 then using sudo useradd <username> -m -s /bin/bash then sudo passwd <username> to give them a password. Restart and login as that new user. Give them admin. role. Copy files from old home admin user directory to new one. Optionally delete the old user.

Bit of a cludge but I have no idea what was causing the kickout at login and didn't have time to find out so this was quick and required minimal knowledge of command line.

BuZZ-dEE
  • 14,533
0

I had this same issue, and I could not find any solution so I decided to install gnome3 instead of unity to sort of side-step the issue. Turns out there was an error in the initialization of dpkg service. I ran

sudo dpkg --configure -a
and it worked like a charm.
Shmit
  • 1