• 完美解决:sh: /usr/bin/xauth: not found


    前言

    如下所示:这是一个使用ssh登录的时候,一个提示信息,不理它也没关系。

    小问题中可能隐藏着大问题,所以搞定它。

    实测发现,这个问题解决了以后,登录速度提升了。

    一 xauth

    xauth是什么

            简言之:不知道

    xauth可能是什么

            auth好像认证单词的前几个字母;那就是认证相关的吧,从别的地方复制一个xauth,放到自己的根文件系统的/usr/bin目录中。

    authentication
    证明真实性,鉴定;身份验证,认证;

     补:

    xauth文件我是重正点原子的IMX6的板子根文件系统中复制过来的,然后,后来的其他的依赖库也是如此。

    补:

    当然不能从ubuntu中复制,因为ubuntu中是X86的啊

    补:

    正点原子也提供了嵌入式的UBUNTU根文件系统,当然用ARM版本的UBUNTU根文件系统应该是可以的吧,不过,我没试过。

    二 cp -rdf用法解析

    cp xxx yyy -rdf,解释一下,-r 和-f很常用,只有-d不常用。

    -r

    -r就是递归

    -R, -r, --recursive
                  copy directories recursively

    -f

    最常用-f复制或者删除,rm后面加-f不会有文件不存在的提示。

    -f, --force
                  if an existing destination file cannot be opened, remove it and try again (this option is ignored when the -n option is also used)
     

    -d选项

    --preserve=links,这句表示-d选项是保持链接关系的。

    -d     same as --no-dereference --preserve=links

    三 再次ssh登录

    /usr/bin/xauth: error while loading shared libraries: libXau.so.6: cannot open shared object file: No such file or directory

    将libXau.so.6也复制过来到到自己的/usr/lib目录,注意要加rdf,rdf的意思是保持链接关系。

    cp ./usr/lib/libXau.so.6* ~/nfsroot/buildrootfs/usr/lib/ -rdf

    如果还是提示找不到,就chown root /usr/lib/libXext.so.6*如下所示:

    1. # chown root /usr/lib/libXau.so.6*
    2. #

    四 再再次登录

     提示:

    /usr/bin/xauth: error while loading shared libraries: libXext.so.6: cannot open shared object file: No such file or directory
     

    相同的方法,从别人的根文件系统中复制过来。

    cp ./usr/lib/libXext.so.6* ~/nfsroot/buildrootfs/usr/lib/ -rdf

    到板子上执行文件的属主命令

    chown root /usr/lib/libXext.so.6*
    

    然后重启。在ssh登录

    又报错了

    /usr/bin/xauth: error while loading shared libraries: libXmuu.so.1: cannot open shared object file: No such file or directory
     

    相同方法

    1. cp ./usr/lib/libXmuu.so.1* ~/nfsroot/buildrootfs/usr/lib/ -rdf
    2. chown root /usr/lib/libXmuu.so.1*

    /usr/bin/xauth: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory

    相同方法

    1. cp ./usr/lib/libX11.so.6* ~/nfsroot/buildrootfs/usr/lib/ -rdf
    2. chown root /usr/lib/libX11.so.6*

    libxcb.so.1:

    1. cp ./usr/lib/libxcb.so.1* ~/nfsroot/buildrootfs/usr/lib/ -rdf
    2. chown root /usr/lib/libxcb.so.1*

    libXdmcp.so.6

    1. cp ./usr/lib/libXdmcp.so.6* ~/nfsroot/buildrootfs/usr/lib/ -rdf
    2. chown root /usr/lib/libXdmcp.so.6*

    五 终于把库补齐啦

    现在报的提示是:

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

    还是复制文件

    sudo cp .Xauthority ~/nfsroot/buildrootfs/home/root/
    

    再重启,哇,没有找不到东西的提示啦。特别好。

    总结

            解决问题,就是very happy。把这个问题解决了以后,ssh登录的速度提升了。

  • 相关阅读:
    百度百科怎么快速创建人物词条?教你几招技巧!
    Linux工具——gdb
    大数据-之LibrA数据库系统告警处理(ALM-12053 主机文件句柄使用率超过阈值)
    QAnything部署Mac m1环境
    python-绘图与可视化
    通关 MySQL获奖名单已公布
    哪种蓝牙耳机降噪好?适合国庆假期使用的蓝牙耳机推荐
    使用Xshell远程连接虚拟机的linux
    自动定量包装机机械及控制系统设计(PLC控制)
    2023.09.03 学习周报
  • 原文地址:https://blog.csdn.net/yueni_zhao/article/details/126744987