LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to get an motd (or equivalent) to users of gdm? (https://www.linuxquestions.org/questions/linux-server-73/how-to-get-an-motd-or-equivalent-to-users-of-gdm-585456/)

pcardout 09-18-2007 12:38 AM

How to get an motd (or equivalent) to users of gdm?
 
Hi -- My enthusiasm for Linux and computational physics has
lead me to start a small lab in which all the clients have
nfs-mounted the same server drive. This gives the student users
access to their data and configuration files no matter which
client in the lab they log into. I have some cute routines for
propagating password changes from the host to all the clients -- and they also propagate an motd file. I would like to make use of this motd. Problem is, most users login through gdm, so they
never see an motd.

I have two questions

1) Is there a facility for gdm comparable to motd?
(I see there is a "postlogin" feature)
http://www.gnome.org/projects/gdm/docs/gdmtalk.pdf

2) How can I distinguish whether user has launched a bash
shell on the local machine or is using ssh?

Even if users log in through GDM, many of them will eventually launch a terminal. I could edit the default .bashrc as follows:

Code:

if test -f /etc/motd
  then
  cat /etc/motd
fi

The problem is that if users login remotely via (ssh), they'll see the motd twice. This is not elegant. So I need to check whether they are using ssh or launching a local xterm. There are some posts about shopt, but I discovered that it did not do a good job
telling me whether a shell was remote or on the local machine.
I welcome suggestions.

doublejoon 09-18-2007 01:54 PM

Bring up your GDM config

Code:

gdmsetup
Change Welcome message to custom and enter your text
and/or
Change Style to "Plain with face browser"
and Enable Logo image

Make a custom .png image file with your custom message in it and use this as your logo.

pcardout 09-19-2007 12:14 AM

Thanks Doublejoon. I'm still soliciting ideas, as a
a plain old text file is a lot easier to edit than changing a .png file everytime you
want to change the log-on message.

I also have used the welcome message -- but it appears to only be good for
about 3-4 words.


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