2

I'm having trouble getting x11 forwarding when I ssh into a linux machine from a MAC operating Mojave. When I do ssh -X username@serveraddress, I get the following error appearing after I successfully login:

/usr/bin/xauth: error in locking authority file /home/username/.Xauthority 

I have tried to follow the fixes suggested to this problem on stackoverflow but they don't seem to work.

I have tried editing ~/.ssh/config so that it looks like this:

Host *
    XAuthLocation /opt/X11/bin/xauth

This does not fix the problem. Any ideas would be greatly appreciated.

1 Answer 1

2

Obviously you should remove the change you made to $HOME/.ssh/config. It doesn't work, and never will, because the path is wrong, and that takes place on the server side anyway.

After that, you should ssh to the server and delete the existing $HOME/.Xauthority file. Then log out, and ssh back in.

This error occurs because the file could not be locked, and that is usually also because it could not be written. So if the problem persists, check the permissions of your home directory on the server.

1
  • Hi, I tried remove the .Xauthority file on the server I log in to (it's actually two different machines, that both have the same problem). I also deleted it on my Mac but my Mac instantly creates a new one. Neither of these options fixed the problem. Currently the permissions on the file look like this: -rw------- 1 dsmith staff 0 26 Feb 13:26 .Xauthority
    – user_h
    Feb 26, 2019 at 12:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .