In the login screen press CTRL + Shift + F1 into the command line mode, enter your user name and password, type the following lines of command on it!
$ cd ~$ sudo chown your username: your user name. Xauthority : Specifies that the owner of the file changes to the specified user or group, and the user can be either a user name or a user ID
Explain:
Xserver start, read the file ~/. Xauthority, read the record corresponding to its display. When a client program that needs to be displayed starts the call Xopendisplay () also reads this file and sends the found magic code to Xserver. When Xserver validates this magic After code is correct, you agree to connect.
Observing the StartX script also sees that every time StartX runs, a new record is added to ~/with the add command that Xauth was used before calling Xinit. Xauthority, used for this run X use authentication
Fixed an issue where Ubuntu entered the correct password and was unable to enter the desktop and remained on the login screen.