gpt4 book ai didi

bash - 没有欢迎横幅的ssh登录

转载 作者:行者123 更新时间:2023-11-29 08:54:44 25 4
gpt4 key购买 nike

我正在从一个程序中使用 ssh,该程序向 ssh 发送命令并解析答案。但是,每次登录时,我都会收到如下欢迎横幅:

Linux mymachine 3.2.0-4-686-pae #1 SMP Debian 3.2.54-2 i686

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
...

我不想要这个横幅,因为我的解析器需要处理它。是否可以使用 ssh 登录而不是一开始就得到这个横幅?

最佳答案

通过将 -q 传递给 SSH,您应该能够关闭此横幅和其他诊断消息:

ssh -q user@remote_host

如果你想让 -q 永久适用于你所有的 SSH session ,请执行以下操作:

echo "LogLevel QUIET" >> ~/.ssh/config

关于bash - 没有欢迎横幅的ssh登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22891708/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com