Motd handling in Debian Jessie – Fixed

30 04 2015

One of the changes made in Debian Jessie was the flow of the generation of the message of today – motd – when a user log in trought a ssh session. Now, a dynamic motd isn’t available, the scripts located inside “/etc/update-motd.d/” arent executed.

For fix the problem, it’s neccesary to edit the pam of ssh:

In “/etc/pam.d/sshd”, add the following lines:
After:...
# Standard Un*x session setup and teardown.
@include common-session
 
# Print the status of the user's mailbox upon successful login.
session optional pam_mail.so standard noenv # [1]
...
Before:...
 # Standard Un*x session setup and teardown.
@include common-session
 
# Print the message of the day upon successful login.
session optional pam_exec.so type=open_session stdout /bin/run-parts /etc/update-motd.d
session optional pam_motd.so
 
# Print the status of the user's mailbox upon successful login.
session optional pam_mail.so standard noenv # [1]
...

Now, add any script that you want to “/etc/update-motd.d” with the format XX-name and make it executable. Log out and log in to test the new behaviour.

More info:
https://lists.debian.org/debian-devel/2014/12/msg00368.html

Advertisements

Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: