chown username:username .Xauthority
12,379
Solution 1
The command is
sudo chown roey:roey .Xauthority
1st roey
is the user, 2nd is the group roey
Solution 2
If you don't know what username/group you shoud use, I suggest using something like this:
sudo chown $USER:`id -gn` .Xauthority
$USER
will be expanded into your current username.id -gn
will returns the main group of your current user.
Related videos on Youtube
Author by
Roey
Updated on September 18, 2022Comments
-
Roey almost 2 years
I'm stuck in a login loop Ubuntu 17.04. When I go to tty1 and type
chown username:roey .Xauthority
taken from Ubuntu gets stuck in a login loopIt says that my user doesn't exist.
What is the problem? How can I log back in to Ubuntu-Gnome?
-
Joshua about 7 yearsrm .Xauthority and allow it to get recreated
-
-
Zanna about 7 years+1, but you will need
sudo
if it's not yours already and btw the secondroey
is superfluous as just adding the colon after the first one changes the group as well -
Roey about 7 yearsto finish this press ALT+-> several times (in my case it's 6 tty's so 6 times) until you get into the Ubuntu-Gnome login screen and login.
-
cat about 7 years@Roey Also CTRL+ALT+F7
-
David Foerster about 7 yearsAre you sure you don't mean
$USER:`id -gn`
(note the colon character in the middle)? Also, that would be equivalent to just$USER:
sincechown
uses the primary group of the specified user if you omit the group name. -
Ravexina about 7 years@DavidFoerster Both
:
and.
will work fine, didn't know about omitting group like$USER:
, good point +1 :-) -
Ravexina about 7 yearscheck
info coreutils
and the section which is aboutchown
. I'll change it to:
in case of username contains dot. -
David Foerster about 7 yearsIndeed: “New scripts should avoid the use of `.' because it is not portable […].” Looks like we both learned something today. :-]
-
Ravexina about 7 yearsYeah, I just used it to show an alternative approach and it caused us to learn something new :)
-
Rafael_Espericueta almost 7 yearsThat didn't fix my problem, sadly.
-
Rinzwind almost 7 years@rafael but did you also get the same error notice? Have a look at the .xsessions_errors file in your home