Alterando o MOTD do Ubuntu Server

Pra quem não sabe o que é, o MOTD (Message of the day) é aquela mensagenzinha que aparece sempre que você se loga no SSH ou faz login no modo texto. É algo mais ou menos assim:

flavio@localhost’s password:
Linux doritos 2.6.24-21-generic #1 SMP Tue Oct 21 23:43:45 UTC 2008 i686

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/
Last login: Tue Nov  4 16:05:15 2008 from localhost
flavio@doritos:~$

Para alterar esses textos, não basta editar o /etc/motd (isso no Ubuntu Server). Fiz algumas mudanças nele e essas alterações foram resetadas ao reiniciar o servidor. Foi ai que vi que o /etc/motd é apenas um link para /var/run/motd. Então, para alterar de verdade o MOTD no Ubuntu Server você precisa editar é o /var/run/motd.

Mas se você quiser tirar a linha Last Login, já é nas configurações do ssh:

flavio@doritos:/var/www$ cat /etc/ssh/sshd_config | grep PrintLastLog
PrintLastLog yes
flavio@doritos:/var/www$

Pronto, trocou nessa linha yes por no e a linha Last Login ao logar por SSH não vai aparecer mais, apesar de eu recomendar deixar ela sempre aparente.

Recomendo também um ASCII Generator pra você fazer firulas no MOTD: http://www.network-science.de/ascii/

One Response

  1. Jefferson Says:

    Muito bom me ajudou muito nota 10!
    Visitem meu Website também Abraços!

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.