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?

share|improve this question
1  
I installed gnome-shell and I could access my account from there, then I disabled desktop sharing and I logged out and logged in with Unity - it worked (either reconfiguring lightdm/gdm or disabling desktop sharing). – wajs Oct 28 '13 at 12:40
    
most likely reconfiguring lightdm/gdm; this has been a solution on one of the questions here before. Just use gdm or another version of lightdm, for example lightdm-gtk-greeter – Sergiy Kolodyazhnyy Feb 7 '15 at 16:07
    
As soon as I turned on desktop sharing this happened to me -- If I try to login with that user, I'm immediately logged back out. This is insane. – BrainSlugs83 Feb 7 '16 at 6:22
1  
This will also happen if you somehow inadvertently remove libssl from your system. Very obscure, but reinstalling it via package download resolved the issue (dpkg -i ...). I only discovered it chasing after another issue with wpa_supplicant not working. At least it told me libssl was missing. – rdev5 Apr 8 '16 at 20:53
    
Not sure why I can't add this as answer (I have 101 rep here because of other SE sites), so adding this as comment. I just had the same problem on 14.04 after a routine sudo apt-get update and upgrade followed by reboot. The problem was caused by proprietary AMD drivers not being compatible with my kernel (I think). The following solved it: sudo apt-get purge fglrx and sudo apt-get purge fglrx-\* and then reboot. Hope that helps someone! – EelkeSpaak Apr 14 '16 at 15:25

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.

share|improve this answer
2  
Just for reference, it happened to me after I run sudo startx while logged in with the same profile user. Deleting it was enough. – user221931 Apr 2 '14 at 14:33
1  
thank you so much, happened to me after a corrupt configuration of tightvnc – Jandalf Aug 13 '14 at 21:14

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.

share|improve this answer
    
(I am aware that this is not the problem @wajs has, but it might be useful for people looking for the symptoms in Google, where this question is in the top 3 results) – Mark Mar 17 '14 at 6:47

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)

share|improve this answer
    
This might be dangerous - what will this command do? – Tim Jul 17 '14 at 19:04
    
As with any action as root, proceed with caution. The OP installed a VNC server and turned on desktop sharing, which tells me they have root privileges. Because of the desktop sharing, some config files' ownership in the user's home folder may have been modified. @Tim, the chown command changes ownership of files and directories. The -R option changes ownership of all files and directories in the current directory, and all subdirectories (recursively). – Tony Rozza Jul 17 '14 at 19:46
    
Changes the to what? – Tim Jul 17 '14 at 21:02
    
This is exactly my issue. I had user with name of "anton" for example in my home partition. Then I re-installed ubuntu on the root partition and mounted home again. The user of new system was named "anton" and system didn't created new folder for this user and used the old one. So I had to change owner of the old folder though the username was the same. – antongorodezkiy Oct 23 '15 at 0:14
    
@Tim changes to youruser:yourgroup in the example above. – antongorodezkiy Oct 23 '15 at 0:15

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.

share|improve this answer

Reinstall unity, by using the following commands:

sudo apt-get update
sudo apt-get install --reinstall ubuntu-desktop
sudo apt-get install unity
share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

protected by Community Jun 18 '15 at 7:21

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.