Ubuntu 16.04 輸入密碼登陸後閃回到登錄界面
在 Ubuntu 16.04 登陸界面輸入密碼 + Enter,閃現黑屏,又跳回到登錄界面。
1. /usr/bin/xauth: /home/deepnorth/.Xauthority not writable, changes will be ignored
[email protected]'s password:
┌────────────────────────────────────────────────────────────────────┐
│ • MobaXterm 12.1 • │
│ (SSH client, X-server and networking tools) │
│ │
│ ➤ SSH session to [email protected] │
│ • SSH compression : ✔ │
│ • SSH-browser : ✔ │
│ • X11-forwarding : ✔ (remote display is forwarded through SSH) │
│ • DISPLAY : ✔ (automatically set on remote server) │
│ │
│ ➤ For more info, ctrl+click on help or visit our website │
└────────────────────────────────────────────────────────────────────┘
Welcome to Ubuntu 16.04.6 LTS (GNU/Linux 4.15.0-54-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
151 packages can be updated.
101 updates are security updates.
Last login: Sat Oct 12 11:47:28 2019
/usr/bin/xauth: /home/deepnorth/.Xauthority not writable, changes will be ignored
deepnorth@deepnorth-amax:~$
2. .Xauthority
主目錄下的 .Xauthority
文件擁有者變成了 root,導致用戶登陸的時候無法都取 .Xauthority
文件。
.Xauthority
文件是 startx 腳本記錄文件。Xserver 啓動時,讀文件 ~/.Xauthority
中對應 display 的記錄。每次 startx 運行,都在調用 xinit 以前使用了 xauth 的 add 命令添加了一個新的記錄到 ~/.Xauthority
,用來這次運行 X 使用認證
deepnorth@deepnorth-amax:~$ ll
total 332
drwxr-xr-x 21 deepnorth deepnorth 4096 10月 14 09:48 ./
drwxr-xr-x 13 root root 4096 8月 12 15:17 ../
......
-rw------- 1 root root 59 10月 11 10:23 .Xauthority
-rw------- 2 deepnorth deepnorth 0 10月 14 09:46 .Xauthority-c
-rw------- 2 deepnorth deepnorth 0 10月 14 09:46 .Xauthority-l
......
3. sudo chown username:username .Xauthority
將 .Xauthority
的擁有者改爲登陸用戶。
deepnorth@deepnorth-amax:~$ sudo chown deepnorth:deepnorth .Xauthority
[sudo] password for deepnorth:
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ ll
total 332
drwxr-xr-x 21 deepnorth deepnorth 4096 10月 14 09:48 ./
drwxr-xr-x 13 root root 4096 8月 12 15:17 ../
......
-rw------- 1 deepnorth deepnorth 59 10月 11 10:23 .Xauthority
-rw------- 2 deepnorth deepnorth 0 10月 14 09:46 .Xauthority-c
-rw------- 2 deepnorth deepnorth 0 10月 14 09:46 .Xauthority-l
......
deepnorth@deepnorth-amax:~$
deepnorth@deepnorth-amax:~$ sudo reboot
Remote side unexpectedly closed network connection
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Session stopped
- Press <return> to exit tab
- Press R to restart session
- Press S to save terminal output to file
authority [ɔːˈθɒrəti]:n. 權威,權力,當局