Ale*_*der 8 linux ssh permissions
我知道通过具有启动SSH会话时,您可以禁用上次登录和信息的最日的消息PrintLastLog no,并PrintMotd no在/etc/ssh/sshd_config。
但是,我无权/etc/ssh/sshd_config在我访问的系统中进行修改。有没有一种方法来设置PrintLastLog no,并PrintMotd no仅用于我的本地用户?
Dwi*_*cer 10
是的,您可以,将Match User指令添加到您的 sshd_config 文件中,如下所示:
Match User root
PrintlastLog no
PrintMotd no
Run Code Online (Sandbox Code Playgroud)
该Match指令也适用于Group并Address匹配 GEOS/Unix 组和 IP 地址追溯。
更新:
作为无法访问 sshd_config 的每个用户的基础,那么您只需创建一个空文件,$HOME/.hushlogin该文件将阻止 bash 在交互模式下输出这些警报。这也适用于使用login(1)telnet 和 screen 会话等其他系统。
更新 2:
要Banner在每个会话的基础上抑制sshd的输出,请使用ssh -q <host>或包含LogLevel quiet在您的 ~/.ssh/config 中
| 归档时间: |
|
| 查看次数: |
12847 次 |
| 最近记录: |