ssh logins and /etc/issue banners

hi,

i have a custom banner configured sshd_config as follows:


Code:
Banner /etc/issue

this displays the login banner as soon as the user connects via ssh/sftp. does anyone know how i can setup different logon banners for different users? for example, i have a user i want to warn about their account being expired.

thanks
 
I don't know about 'personalised banners' being possible. You could, however, put something in the user shell's rc file (.cshrc, .bashrc, .profile, what have you). This will print right under the motd.
 
@phospher: you could also let chpass(1) do the work for you.

Code:
$ ssh mrbig@my.host
Password:

[b]Warning: your account expires on Thu Sep 17 00:00:00 2009[/b]

Last login: Sat Sep 12 16:08:20 2009 from dhcp-10-50-111-

Copyright (c) 1980, 1983, 1986, 1988, 1990, 1991, 1993, 1994
	The Regents of the University of California.  All rights reserved.

If you want to play CDs with FreeBSD, a utility for this is already included.
Type 'cdcontrol' then 'help' to learn more.  (You may need to set the CDROM
environment variable in order to make cdcontrol want to start.)
>

It seems to warn users automatically when they're expired that way. (I am not sure when it starts warning them, exactly, but you could experiment on a test account.)
 
that works great for ssh but doesn't display for sftp. probably because it's not considered an interactive login session.
 
Back
Top