How to create .Xauthority manually
Post Date: 2019-10-16
If .Xauthority does not exist in user home directory, it will show below error:
xauth
xauth: file /root/.Xauthority does not exist
Using authority file /root/.Xauthority
Below are the steps to manually create the .Xauthority
under user home directory
touch ~/.Xauthority
# Generate the magic cookie with 128 bit hex encoding
xauth add ${HOST}:0 . $(xxd -l 16 -p /dev/urandom)
# Verify the result and it shouldn't show any error
xauth list
References: