Giter VIP home page Giter VIP logo

dynamic-motd's Introduction

Dynamic motd

The aim of this project is to give some informations when you log into a server through SSH.

Example:


   ___  ___ _ ____   _____ _ __
  / __|/ _ \ '__\ \ / / _ \ '__|
  \__ \  __/ |   \ V /  __/ |
  |___/\___|_|    \_/ \___|_|


  Debian GNU/Linux 8.4 (jessie) (kernel 3.16.0-4-amd64)


  System information as of Fri Apr 22 10:02:57 2016

  System load:  2.74                 Processes:           167
  Memory usage: 98%                  Users logged in:     1
  Swap usage:   31%
  Disk Usage:
    Usage of /                       : 37.0% of 19.18GB
    Usage of /boot                   : 36.6% of 0.11GB
    Usage of /home                   : 11.1% of 501.60GB
  Inode Usage:
    Usage of /                       : 12.7% of 1286144
    Usage of /boot                   : 1.1% of 31232
    Usage of /home                   : 0.1% of 33406976

  Logged in users:
  user       from laptop.example.org        at Fri Apr 22 09:09:09 2016

No mail.
Last login: Fri Apr 22 09:23:01 2016 from laptop.example.org

Warning This is Debian and Debian-related distributions only.

Dependencies

You need to install some packages:

apt-get install figlet lsb-release python-utmp bc

Optionnally, you can install needrestart which is used to show a message if your server need a reboot (main reason (and the only one I know): you have upgraded your kernel). If you don't install needrestart, it will work, but you won't be warned about the need for a reboot. needrestart warns you about services that need to be restarted too (but is slower than checkrestart for that, see below).

You can optionnally install debian-goodies which provides checkrestart, which will be used to warn you about services that need to be restarted. Relying on needrestart for that is slow (±7 seconds) while checkrestart do it faster (less than one second).

NB: if you use Debian 11 Bullseye, install python3-utmp instead of python-utmp and change python to python3 in update-motd.d/20-system-info and update-motd.d/sysinfo.py:

sed -e "s/python/python3/" -i update-motd.d/20-system-info update-motd.d/sysinfo.py

Installation

cp -r update-motd.d/ /etc
rm /etc/motd
ln -s /var/run/motd /etc/motd

Disabling for some users

Just create a /etc/update-motd.d/hushlogin file containing the names of the users, like:

alice
bob

Salt

You will find a working salt formula in init.sls.

cd /srv/salt
git clone https://framagit.org/luc/dynamic-motd.git motd
salt your_server state.sls motd

License

GPLv2. Have a look at the LICENSE file.

Acknowledments

dynamic-motd's People

Contributors

ldidry avatar jonathanplatzer avatar mbothorel avatar vindolin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.