.Xauthority 파일에 쓸 수 없는 Xauth/X11 SSH 전달 오류

.Xauthority 파일에 쓸 수 없는 Xauth/X11 SSH 전달 오류

으로 로그인하면 ssh -Y remotehost다음과 같은 오류 메시지가 나타납니다.

/usr/bin/xauth: /home/hlovdal/.Xauthority는 쓸 수 없으며 변경 사항은 무시됩니다.

그리고 xclock 및 이와 유사한 기능이 시작되지 않습니다. 오류 메시지에도 불구하고 .Xauthority 파일의 권한에는 아무런 문제가 없습니다.

(hlovdal) remotehost:~>xclock
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
X11 connection rejected because of wrong authentication.
Error: Can't open display: localhost:10.0
(hlovdal) remotehost:~>ls -l /home/hlovdal/.Xauthority
-rw-------. 1 hlovdal hlovdal 70 Jul 25 23:30 /home/hlovdal/.Xauthority
(hlovdal) remotehost:~>

여기에 원인이 무엇일까요?

(이것은 이전에 수백 번 앞뒤로 shh-ed했던 두 개의 노트북 사이에 있습니다.)


업데이트:

추가로 디버깅하는 동안 xauth는 .Xauthority에 쓸 수 없다고 다시 불평했습니다. 이것은 내 사용자가 파일에 쓸 수 있기 때문에 말이 되지 않으며, 호기심에 strace를 실행하여 정확히 무엇을 하려고 했는지 확인했습니다.

(hlovdal) remotehost:~>xauth list
xauth:  /home/hlovdal/.Xauthority not writable, changes will be ignored
(hlovdal) remotehost:~>strace -oout -f -s9000 xauth list
xauth:  error in locking authority file /home/hlovdal/.Xauthority
(hlovdal) remotehost:~>tail out
16634 brk(0xf03000)                     = 0xf03000
16634 brk(0)                            = 0xf03000
16634 rt_sigaction(SIGINT, {0x4050d0, [INT], SA_RESTORER|SA_RESTART, 0x3957035350}, {SIG_DFL, [], 0}, 8) = 0
16634 rt_sigaction(SIGTERM, {0x4050d0, [TERM], SA_RESTORER|SA_RESTART, 0x3957035350}, {SIG_DFL, [], 0}, 8) = 0
16634 rt_sigaction(SIGHUP, {0x4050d0, [HUP], SA_RESTORER|SA_RESTART, 0x3957035350}, {SIG_DFL, [], 0}, 8) = 0
16634 rt_sigaction(SIGPIPE, {0x4050d0, [PIPE], SA_RESTORER|SA_RESTART, 0x3957035350}, {SIG_DFL, [], 0}, 8) = 0
16634 stat("/home/hlovdal/.Xauthority-c", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
16634 open("/home/hlovdal/.Xauthority-c", O_WRONLY|O_CREAT|O_EXCL, 0600) = -1 EEXIST (File exists)
16634 write(2, "xauth:  error in locking authority file /home/hlovdal/.Xauthority\n", 66) = 66
16634 exit_group(1)                     = ?
(hlovdal) remotehost:~>ls -l .Xauthority*
-rw-------. 1 hlovdal hlovdal 70 Jul 25 23:30 .Xauthority
-rw-------. 2 hlovdal hlovdal  0 Jul 26 01:26 .Xauthority-c
-rw-------. 2 hlovdal hlovdal  0 Jul 26 01:26 .Xauthority-l
(hlovdal) remotehost:~>

이는 .Xauthority-c 생성에 실패하여 xauth가 실패하는 이유를 더 잘 설명합니다. 그러나 오래된 두 파일을 제거해도 도움이 되지 않으며 다음 SSH 로그인 시 다시 생성됩니다. 원격 호스트의 syslog에는 ssh 로그인과 관련된 다음 내용이 포함되어 있습니다.

sshd[17551]: Accepted publickey for hlovdal from x.x.x.x port 36545 ssh2
sshd[17552]: fatal: mm_request_receive: read: Connection reset by peer
sshd[17551]: pam_unix(sshd:session): session opened for user hlovdal by (uid=0)

이 mm_request_receive 오류 메시지는 이전에 발생한 적이 없으므로 추가 디버깅에 대한 단서가 있는 것 같습니다.

답변1

Ubuntu 12.04에서 홈 폴더를 동기화한 후에도 동일한 문제가 발생했습니다. 다음 명령을 사용하여 문제를 해결했습니다.

rm ~/.Xaut* 

그런 다음 로그아웃했다가 다시 로그인했습니다. 다음 경고가 발생했습니다.

/usr/bin/xauth:  file /home/iranice/.Xauthority does not exist

그 후 Linux는 .Xauthority자동으로 파일을 생성했습니다. 로그아웃했다가 다시 로그인했는데 모든 것이 정상이었습니다.

답변2

나에게는 다음과 같은 오류가 발생했습니다.

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

내 /home 파티션이 가득 찼기 때문입니다.

이 파티션의 일부 공간을 확보하면 이 문제가 해결되었습니다.

strace 명령은 strace -oout -f -s9000 xauth list문제를 식별하는 데 유용했습니다.

답변3

이는 다음 사이트에 보고된 이미 알려진 문제인 것 같습니다.Redhat의 버그질라, 따라서 이 질문을 "닫고" 계속해서 해당 버그 보고서를 보고하겠습니다.

답변4

나에게 문제는 권한 문제였습니다. 파일을 삭제해도 .Xauthority다시 생성되어 쓸 수 없게 되었습니다. 그래서 소유자를 바꾸었고 작동했습니다.

sudo chown user:user .Xauthority

파일이 기본적으로 루트용으로 생성되었을 수 있습니다.

관련 정보