现象
ssh登录Ubuntu时,速度很慢,输出信息如下:
┌────────────────────────────────────────────────────────────────────┐│ • MobaXterm 20.3 •││ (SSH client, X-server and networking tools) ││ ││ ➤ SSH session to book@192.168.8.191 ││ • 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 18.04.2 LTS (GNU/Linux 5.4.0-52-generic x86_64)* Documentation: * Management:* Support: /advantage* Introducing self-healing high availability clustering for MicroK8s!Super simple, hardened and opinionated Kubernetes for production.https://microk8s.io/high-availability* Canonical Livepatch is available for installation.- Reduce system reboots and improve kernel security. Activate at:/livepatch219 packages can be updated.15 updates are security updates.New release '20.04.1 LTS' available.Run 'do-release-upgrade' to upgrade to it.Your Hardware Enablement Stack (HWE) is supported until April .Last login: Wed Nov 4 20:51:41 from 192.168.8.116/usr/bin/xauth: timeout in locking authority file /home/book/.Xauthoritybook@100ask:~$
可以看到出错信息为:
/usr/bin/xauth: timeout in locking authority file /home/book/.Xauthority
解决方案
查看当前用户读写权限:
(备注,此处用户是book)
book@100ask:~$ cd ..book@100ask:/home$ lltotal 36drwxr-xr-x 6 root root 4096 Nov 3 20:37 ./drwxr-xr-x 26 root root 4096 Nov 3 20:30 ../dr-xr-xr-x 39 book book 4096 Oct 29 04:05 book/drwxr-xr-x 24 gerrit gerrit 4096 Nov 4 04:34 gerrit/drwx------ 2 root root 16384 Feb 20 lost+found/drwxr-xr-x 20 nano nano 4096 Nov 4 20:48 nano/book@100ask:/home$
我的Ubuntu有三个用户,分别为book 、gerrit、nano
从上图结果可以看出,book
文件夹缺少写w
权限
解决方案:
book@100ask:/home$ sudo chmod 755 book/book@100ask:/home$ lltotal 36drwxr-xr-x 6 root root 4096 Nov 3 20:37 ./drwxr-xr-x 26 root root 4096 Nov 3 20:30 ../drwxr-xr-x 39 book book 4096 Oct 29 04:05 book/drwxr-xr-x 24 gerrit gerrit 4096 Nov 4 04:34 gerrit/drwx------ 2 root root 16384 Feb 20 lost+found/drwxr-xr-x 20 nano nano 4096 Nov 4 20:48 nano/book@100ask:/home$
再次ssh登录到book用户,报错消失,也不会卡顿:
┌────────────────────────────────────────────────────────────────────┐│ • MobaXterm 20.3 •││ (SSH client, X-server and networking tools) ││ ││ ➤ SSH session to book@192.168.8.191 ││ • 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 18.04.2 LTS (GNU/Linux 5.4.0-52-generic x86_64)* Documentation: * Management:* Support: /advantage* Introducing self-healing high availability clustering for MicroK8s!Super simple, hardened and opinionated Kubernetes for production.https://microk8s.io/high-availability* Canonical Livepatch is available for installation.- Reduce system reboots and improve kernel security. Activate at:/livepatch219 packages can be updated.15 updates are security updates.New release '20.04.1 LTS' available.Run 'do-release-upgrade' to upgrade to it.Your Hardware Enablement Stack (HWE) is supported until April .Last login: Wed Nov 4 20:55:15 from 192.168.8.116book@100ask:~$book@100ask:~$
此问题同时还会导致,Ubuntu无法进入book用户的Gnome界面,而其他用户Gnome界面正常!