Operating System - HP-UX
1833016 Members
2705 Online
110048 Solutions
New Discussion

Openssh display /etc/motd

 
SOLVED
Go to solution
Bosco Tsang
Valued Contributor

Openssh display /etc/motd

I am using the openssh from hp depot. Everything when I login via ssh, the /etc/motd message will display twice. Why? How can I set it so that it will only display once?

Also, can I set it so that it can display different motd for ssh login and telnet login?
7 REPLIES 7
Domenico_5
Respected Contributor

Re: Openssh display /etc/motd

That message is contained in the file /etc/dmmsg. Make sure that such
a file exists on your node and that it contains the message that you
want to have printed out.


bye

dom
Domenico_5
Respected Contributor

Re: Openssh display /etc/motd

sorry bosco

in add you can edit /etc/inetd.conf and change the lines below:

ftp stream tcp nowait root /usr/lbin/ftpd
telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b /etc/motd

Then, issue this command:

inetd -c

so when you try to connect you can receive a message.

bye

dom.
Bosco Tsang
Valued Contributor

Re: Openssh display /etc/motd

Hi Domenico, I believe there is a misunderstanding ...what I am seeing is the /etc/motd message (and the copyright note) appeared 2 times when I ssh to the system. Wonder if I can set it to display only once.

Your telnet -b option is for display of /etc/issue file only, not related to /etc/motd.
S.K. Chan
Honored Contributor
Solution

Re: Openssh display /etc/motd

In the /etc/sshd_config file edit the line that has ..
PrintMotd yes
to
PrintMotd no

and restart sshd and that should take care of it. Basically let motd display being done from a shell (eg: /etc/profile), that way it will only be displayed once.
S.K. Chan
Honored Contributor

Re: Openssh display /etc/motd

..I didn't see the other questtion ..

If you want ssh to display different motd message, you can leave "PrintMotd yes" alone but in /etc/inetd.conf file change the "telnet" line to "....telnet -b /etc/warning". Basically create a separate file fot it.

Bosco Tsang
Valued Contributor

Re: Openssh display /etc/motd

Hi Chan, the telnet -b option only for display as /etc/issue, not /etc/motd which appear after login. Any idea?
S.K. Chan
Honored Contributor

Re: Openssh display /etc/motd

sorry typo error .. this is what I got in my /etc/inetd.conf file ..

telnet stream tcp nowait root /usr/lbin/telnetd telnetd -b/etc/warning
login stream tcp nowait root /usr/lbin/rlogind rlogind -B/etc/warning

Note .. no space after the -b or -B options. In my /etc/warning (444 root:root) I got something like ..

********************
* This is a private ...
* ....
********************

For my /etc/motd it's called from /etc/profile and it has slightly different message than /etc/warning.