繁体   English   中英

-e:在 SSH 横幅后找不到命令

[英]-e: command not found after SSH banner

我在对 ubuntu 20 服务器执行 SSH 时打印出以下错误。 没有通过 ssh 执行远程命令。

ubuntu@ip-x-x-x-x:~$ /usr/bin/ssh ubuntu@x.x.x.x
###############################################################
#                 Authorized access only!                     #
# Disconnect IMMEDIATELY if you are not an authorized user!!! #
#         All actions Will be monitored and recorded          #
###############################################################
Last login: Thu Dec  8 05:58:57 2022 from x.x.x.x
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
-e: command not found
ubuntu@given-hostname:~$

我在 profile.d 或 ssh 配置上找不到任何内容。 有谁知道要查找的来源?

当您登录到远程服务器时 - 执行 shell 的登录脚本(如果您将 ssh 发送到 user@remote,它位于 /home/user/,即在 given-hostname->/home/ubuntu 上,当 ubuntu@given-hostname 时)。

您可以检查 shell 在远程主机上为该用户执行了什么:

$ cat /etc/passwd | grep user
$ user:x:1000:1000::/home/user:/bin/bash

如果它是 bash,则 ~/.profile ~/.bashrc ~/.bash_profile 在登录时(在远程主机上)执行,在您的情况下,其中一些包含一些产生“ -e: command not found ”的命令 - 这是不可能的在不查看该脚本文件的情况下说出哪个。 检查提到的文件中包含“-e”的行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM