Ubuntu 16.04 输入密码登陆后闪回到登录界面

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  to exit tab
    - Press R to restart session
    - Press S to save terminal output to file
authority [ɔːˈθɒrəti]:n. 权威,权力,当局

你可能感兴趣的:(Ubuntu,Desktop,Server,LTS)