完美解决: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*如下所示:

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

四 再再次登录

 提示:

/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
 

相同方法

cp ./usr/lib/libXmuu.so.1* ~/nfsroot/buildrootfs/usr/lib/ -rdf
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

相同方法

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

libxcb.so.1:

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

libXdmcp.so.6

cp ./usr/lib/libXdmcp.so.6* ~/nfsroot/buildrootfs/usr/lib/ -rdf
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登录的速度提升了。

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千册

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值