Hide SSH Welcome Banner/Message on Ubuntu14.04+

时间:2022-07-03 08:44:19

Introduction

Usually when you logged in you linux based PC remotely via SSH, a long banner will be displayed, including the os and kernel version of the PC, if new release is available, last login time, bashrc error and more. This helps when you are admin, but really annoying for normal users, and even sometimes admin himself.

➜  ~ ssh Xxxxx@xx.xxx.xxx.xx
Xxxxx@xx.xxx.xxx.xx's password:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-96-generic x86_64) * Documentation: https://help.ubuntu.com/ New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it. Last login: Wed Sep 14 20:58:27 2016 from 10.222.129.26
-bash: ./usr/local/software/ccp4/ccp4-6.5/bin/coot: No such file or directory

The banner is generated by scripts under /etc/update-motd.d/. All are SHELL scripts.

Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-96-generic x86_64)
# the line above is generated by /etc/update-motd.d/00-header * Documentation: https://help.ubuntu.com/ # these lines are generated by /etc/update-motd.d/10-help-text
New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
# those lines are generated by /etc/update-motd.d/91-release-upgrade,
# which executes /usr/lib/ubuntu-release-upgrader/release-upgrade-motd,
# which prints /var/lib/ubuntu-release-upgrader/release-upgrade-available [containing the release msg]
Last login: Wed Sep 14 20:58:27 2016 from 10.222.129.26
# the line is controlled by option `PrintLastLog` in `/etc/ssh/sshd_config`
# if `no' is given, the line will not be printed
# non-last lines are controlled by option `PrintMotd` in `/etc/ssh/sshd_config`
# if `no' is given, all the content in /var/run/motd.dynamic will not be printed

The /var/run/motd.dynamic file contains

Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-96-generic x86_64)

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

New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

customizing the banner

There is a option in /etc/ssh/sshd_config named Banner, which allows you to specify a file containing custom msg to display when users log in. By default, it is commented out as #Banner /etc/issue.net.

Banner /etc/motd.d/custom.banner

simple way to hide all

To hide all message after password prompt, just create a empty file named .hushlogin in your $HOME folder. Next Time you log in, nothing will be printed.

~ $ touch .hushlogin

Hide SSH Welcome Banner/Message on Ubuntu14.04+的更多相关文章

  1. Ubuntu14.04下完美安装cloudermanage多种方式(图文详解)(博主推荐)

    说在前面的话 我的机器是总共4台,分别为ubuntucmbigdata1.ubuntucmbigdata2.ubuntucmbigdata3和ubuntucmbigdata4. ClouderaMan ...

  2. Ubuntu14.04解决远程root-ssh拒绝登录

    (1)查看ip地址是否冲突 我在单位的虚拟机ip地址是192.168.14.85,与其它机器冲突了.改成了192.168.14.83 (2)关闭Ubuntu14.04的防火墙 root@stgman- ...

  3. LNMP虚拟机开发环境配置--vagrant+virtualbox+ubuntu14.04

    工作一直用的是别人打包好的虚拟机开发环境,感觉确实很酷.所以准备自己配个开发环境,为之后自己开发一些有趣的东西做准备. ok,开始~~~ 一.安装软件 vagrant和virtualbox 此处需注意 ...

  4. 搭建ubuntu14.04的hadoop集群【docker容器充当服务器】

    首先弄出来装有hadoop.java.ssh.vim的镜像起名badboyf/hadoop.做镜像有两种方法,一种是用Dockerfile来生成一个镜像,一种是基于ubuntu14.04的基础镜像生成 ...

  5. Ubuntu14.04+RabbitMQ3.6.3+Golang的最佳实践

    目录 [TOC] 1.RabbitMQ介绍 1.1.什么是RabbitMQ?   RabbitMQ 是由 LShift 提供的一个 Advanced Message Queuing Protocol ...

  6. Ubuntu14.04用apt在线/离线安装CDH5.1.2[Apache Hadoop 2.3.0]

    目录 [TOC] 1.CDH介绍 1.1.什么是CDH和CM? CDH一个对Apache Hadoop的集成环境的封装,可以使用Cloudera Manager进行自动化安装. Cloudera-Ma ...

  7. Ubuntu14.04安装ROOT集群

    之前尝试在CentOS7上部署ROOT集群,却发现无论是源码包安装,还是官方提供的二进制包,都缺少了关键的xproofd可执行文件,导致PoD不能运行.没有办法,只能尝试在其他OS上部署,这里我选择了 ...

  8. Ubuntu14.04下安装Hadoop2.5.1 (单机模式)

    本文地址:http://www.cnblogs.com/archimedes/p/hadoop-standalone-mode.html,转载请注明源地址. 欢迎关注我的个人博客:www.wuyudo ...

  9. 在ubuntu14.04上配置cuda_caffe_cudnn_anaconda_digits

    参考网上的很多网站,以这篇为主:http://blog.csdn.net/yhl_leo/article/details/50961542 这篇算是自己对caffe学习的一个总结系列的开头.首先因为c ...

随机推荐

  1. 操作系统中的IPC机制

    按发送路径来看,可分为直接通信和间接通信. 1. 直接通信 (1)进程必须正确的命名对方 send (P, message) – 发送信息到进程P receive(Q, message) – 从进程 ...

  2. 将Mat类型转换成QImage类型

    ui 头文件 #ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include<opencv2/highgui/highgu ...

  3. java&lowbar;List集合及其实现类

    第一章:List集合_List接口介绍 1).特点       1).有序的: 2).可以存储重复元素: 3).可以通过索引访问: List<String> list = new Arra ...

  4. &lbrack;EOJ Monthly 2018&period;10&rsqb;&lbrack;C&period; 痛苦的 01 矩阵&rsqb;

    题目链接:C. 痛苦的 01 矩阵 题目大意:原题说的很清楚了,不需要简化_(:з」∠)_ 题解:设\(r_i\)为第\(i\)行中0的个数,\(c_j\)为第\(j\)列中0的个数,\(f_{i,j ...

  5. Linux给普通用户增加ssh权限

    //1,创建用户 useradd name //2,修改密码 passwd name //3,修改ssh配置文件,在最后一行添加AllowUsers name vi /etc/ssh/sshd_con ...

  6. mysql -- 远程访问mysql的解决方案

    1.改表法 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "u ...

  7. js判断两个日期是否严格相差整年(合同日期常用)

    1.var beginDate = new Date($("#InvoiceStartTime").val()); var endDate = new Date($("# ...

  8. java8 - 3

    import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.functio ...

  9. tp5中nginx配置

    首先tp5的访问目录指向到webroot/public文件夹中. thinkphp的url访问:http://serverName/index.php(或者其它应用入口文件)/模块/控制器/操作/[参 ...

  10. Android开发之应用程序更新实现

    近期给项目app做升级.对Android应用程序更新稍有研究,分享一下我的心得. 既然是更新,那么一定是要联网和下载的.所以联网和存储訪问权限时一定要有的: <!-- 权限申请 -->   ...