LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (http://www.linuxquestions.org/questions/debian-26/)
-   -   ssh banner and motd (http://www.linuxquestions.org/questions/debian-26/ssh-banner-and-motd-4175455027/)

binary_dreamer 03-21-2013 02:03 PM

ssh banner and motd
 
hi.i am trying to setup the ssh banner when i login to my system debian 6.0.7.
i have altered the /etc/motd to my message, but it works until i reboot the system. after that it comes to the original. i have added a custom message to ssh-banner and add it to /etc/ssh/sshd_config.
now when i ssh to the system i get the ssh-banner and the original message from motd.
how to i get rid of the motd forever or make changes permanent to motd?

netnix99 03-21-2013 02:14 PM

There's more than one way to skin a cat... but you can (as root)
Code:

cat /dev/null > /etc/motd
to blank out the motd. I personally put my banner message in /etc/issue (you could use any file), and then in /etc/ssh/sshd_config, find the line
Code:

# Banner none
and change it to
Code:

Banner /etc/issue

binary_dreamer 03-22-2013 05:06 AM

this is what i have done to erase everything from /etc/motd.
after a reboot thought it comes back the default motd

Password:
Last login: Fri Mar 22 11:01:35 EET 2013 on ttyS0
Linux debPBX 2.6.32-5-486 #1 Mon Feb 25 00:22:26 UTC 2013 i586

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

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.



this is that i want to erase permanently.

netnix99 03-22-2013 10:39 AM

...see if you have a sym link from /etc/motd to /var /run/motd

if not, see if /var/run/motd exists, and change it - reboot, and see if your problem disappears...

Let me know! :)

liefde 04-14-2013 07:03 PM

Your ssh banner before login is set in /etc/ssh/sshd_config , so in sshd_config you can set it to say
Code:

Banner none
Furthermore, after succesful login, the ssh linux splash you see is usually configured via /etc/pam.d/sshd and/or /etc/pam.d/login
In those two files, look for the line that says
Code:

session optional pam_motd.so
and comment it out:
Code:

# session optional pam_motd.so
then of course save, close, reload.

If you ask me, those banners are a complete waste of valuable screen-space (and time). First thing I kick out with a new openssh installation.


All times are GMT -5. The time now is 04:08 AM.