The interesting part is I found that I was able to login with xfce but not with either lightdm or gdm. (I am using Ubuntu 16.04)
Did you do something before this problem?
Maybe you run
.Xauthority with sudo.
Log in using
CTRL+ALT+F1 and type:
sudo chown yourusername ~/.Xauthority
I think I figured out my problem, since I am using network computers. After creating and modifying users int /etc/passwd and /etc/shadow. I also need to consider /etc/group /etc/auto.master (in autofs), so I can make sure my new user can be connected into the server.
However, I still don't have a clear explanation why xforce can work under error of /etc/passwd and /etc/shadow