相关疑难解决方法(0)

多彩的 ssh 横幅

我想为我的 ssh 横幅着色。我知道我可以像这样执行它:

/etc/profile我可以放:

echo -e "\e[1;31m Colorful text"
echo -e "\e[0m Reset"
Run Code Online (Sandbox Code Playgroud)

但是我在横幅中有一些带有特殊字符的 ASCII 艺术。有没有办法在不转义 ASCII 艺术中的每个特殊字符的情况下对其进行着色?

colors bash ssh profile

7
推荐指数
2
解决办法
3万
查看次数

如何在“登录为:”提示之前显示 SSH 横幅?

CentOS 5.x

当我Banner /path/to/banner在 sshd 配置文件中启用该参数时,横幅会在login as:提示后显示。

例如:

login as: foo
***********************************************************
Test Example SSH Banner Text
This is a test
Example 12345
***********************************************************
foo@1.2.3.4's password:
Run Code Online (Sandbox Code Playgroud)

诚然,对于使用在连接之前已指定的用户名进行连接的 ssh 连接来说,这不是问题。但是对于没有预先选择用户名的 ssh 连接,用户在连接时会看到:

login as:
Run Code Online (Sandbox Code Playgroud)

有没有办法让横幅在login as:提示之前显示?

centos openssh sshd

3
推荐指数
1
解决办法
9611
查看次数

标签 统计

bash ×1

centos ×1

colors ×1

openssh ×1

profile ×1

ssh ×1

sshd ×1