设置 ssh 登录服务器时的提示文字

issue.net & motd

新开了阿里云的机器之后机器 ssh 过去的默认提示是:

Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-86-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

Welcome to aliyun Elastic Compute Service!

可以加一些内容。一共两个与之相关:

  • issue.net : Display a banner message before the password login prompt.

  • motd : Display a banner message after the user has logged in.

设置 issue.net

在下面文件中添加想要添加的内容

# vim /etc/issue.net

Text to ASCII Art Generator (TAAG) 上面生成了 ASCII Art。

Ubuntu 14.04.4 LTS

  ______ _____  _____ 
 |  ____/ ____|/ ____|
 | |__ | |    | (___  
 |  __|| |     \___ \ 
 | |___| |____ ____) |
 |______\_____|_____/ 

改 config

# vim /etc/ssh/sshd_config

搜索 Banner 并取消掉它的注释

#Banner /some/path

需要 reload ssh

# service ssh reload

motd

Message of the Day 的意思,内容放在 /etc/motd,另外还可以用 UpdateMotd 动态生成的内容,参考 UpdateMotd

这里先不深究,而是直接 apt-get install landscape-common。landscape-common 会显示一些机器的信息。

Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-28-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Tue Jul 12 10:21:51 MDT 2016

  System load:  0.09                Users logged in:        1
  Usage of /:   12.3% of 225.17GB   IP address for enp7s0:  192.168.X.XXX
  Memory usage: 45%                 IP address for wlp9s1:  192.168.X.XXX
  Swap usage:   0%                  IP address for docker0: 172.17.0.1
  Processes:    397

  Graph this data and manage this system at:
    https://landscape.canonical.com/

0 packages can be updated.
0 updates are security updates.

Last login: Tue Jul 12 10:03:16 2016 from 192.168.X.XXX

参考

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值