Ubuntu远程登陆消息横幅

156 阅读1分钟

ssh登陆前显示横幅信息

  1. 打开sshd_config

    vim /etc/ssh/sshd_config
    
  2. 在sshd_config中添加banner路径

    Banner /etc/ssh/banner
    
  3. 在banner中添加横幅文本

    vim /etc/ssh/banner
    
  4. 重启sshd

    systemctl restart sshd
    

*不可使用shell

登录后显示横幅

  1. 打开/etc/update-motd.d文件夹

    cd /etc/update-motd.d
    
  2. 编辑下列文件可修改欢迎信息(按编号显示)

  3.  run-parts /etc/update-motd.d
    

*可使用shell

Motd后打印信息

  1. 编写shell
  2. 将shell路径添加到/etc/profile末尾
  3. source /etc/profile