Customizing /etc/motd

2003-02-13 Thread Colin J. Raven
Greetings all!
I'd like to tweak /etc/motd to give ssh users a personalized login text.

Perhaps something like;

FreeBSD 4.7-STABLE #0: Sun Feb  9 19:32:05 CET 2003 (This already exists
of course)

{username}, Welcome to FreeBSD!
Blah Blah Blah

I notice that last login is the first line in this file, 
snip
Last login: Thu Feb 13 13:55:22 2003 from 131gorio.dsl.provider-name
/snip
yet examining the file itself doesn't show how this is achieved (if it
did, then I would play with it and try extending the functionality)


Can anyone suggest how the above could be accomplished? 
I'm no shellscripting guru, so it needs to be *reasonably* simple :-) 

Regards  TIA,
-Colin



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Customizing /etc/motd

2003-02-13 Thread Dirk-Willem van Gulik


On Thu, 13 Feb 2003, Colin J. Raven wrote:

 I'd like to tweak /etc/motd to give ssh users a personalized login text.

su root
..type root password
vi /etc/motd

or, if you do not know the vi editor, use

su root
..type root password
ee /etc/motd

Done. One normally does not edit/change the first line with FreeBSD ..
as this line is replaced at boot time with the actual version number. If
you remove this line; then that will not happen.

Dw


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



RE: Customizing /etc/motd

2003-02-13 Thread Colin J. Raven

+ On Thu, 13 Feb 2003, Colin J. Raven wrote:
+ 
+  I'd like to tweak /etc/motd to give ssh users a 
+ personalized login text.
+ 
+  su root
+  ..type root password
+  vi /etc/motd
Yes! :-)I know how to edit the file, but I'm trying to figure out how to
personalize it on a per-user login basis.

+ One normally does not edit/change the first line with 
+ FreeBSD ..
+ as this line is replaced at boot time with the actual 
+ version number. If
+ you remove this line; then that will not happen.

AH, interesting. Good info thanks. Luckily I didn't have any intention
of removing it, but nevertheless didn't know that Bad Things(tm) would
happen if I did.

Regards,
-Colin



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Customizing /etc/motd

2003-02-13 Thread Clement Laforet
Last Login is not handled by motd file
It's done by sshd.
in sshd_config
PrintLastLog yes



On Thu, 13 Feb 2003 14:02:44 +0100
Colin J. Raven [EMAIL PROTECTED] wrote:

 Greetings all!
 I'd like to tweak /etc/motd to give ssh users a personalized login text.
 
 Perhaps something like;
 
 FreeBSD 4.7-STABLE #0: Sun Feb  9 19:32:05 CET 2003 (This already exists
 of course)
 
 {username}, Welcome to FreeBSD!
 Blah Blah Blah
 
 I notice that last login is the first line in this file, 
 snip
 Last login: Thu Feb 13 13:55:22 2003 from 131gorio.dsl.provider-name
 /snip
 yet examining the file itself doesn't show how this is achieved (if it
 did, then I would play with it and try extending the functionality)
 
 
 Can anyone suggest how the above could be accomplished? 
 I'm no shellscripting guru, so it needs to be *reasonably* simple :-) 
 
 Regards  TIA,
 -Colin
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-questions in the body of the message

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



RE: Customizing /etc/motd

2003-02-13 Thread Colin J. Raven

+ motd is a flat file, so it won't take the customizations 
+ you'd need to do this :)

Yes indeed, I was aware of this - hence my puzzlement as to how this
might be done.

+ The last login is done by lastlog, which is called by login, 
+ not from motd.

nodding sagely H

+ For infor on both, check the motd(5) and utmp(5) man pages. 

AHA!!! Until now, I didn't realize motd had a man page. Thanks much for
the info.
After reading, I'm no wiser tho'...unless you count the knowledge that
the man page 
exists which was previously unknown to me!! :-)

Regards,
-Colin
Who is still grapping with this issue with grim resolve



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



RE: Customizing /etc/motd

2003-02-13 Thread Dirk-Willem van Gulik

For per user - you may do perhaps someting with /etc/csh.login (assuming
they are using csh). Like adding a check for a file and cating that.

Dw


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Customizing /etc/motd

2003-02-13 Thread Saint Aardvark the Carpeted
Colin J. Raven disturbed my sleep to write:
 Greetings all!
 I'd like to tweak /etc/motd to give ssh users a personalized login text.

Printing the last time the user logged in appears to be part of login(1)
itself, not /etc/motd.  I suppose you could always modify the source
code to print the message you like, but an easier way would be to append
something to /etc/profile:

echo 'Welcome to FreeBSD, $USER!'

$USER is the user's account name.  And it looks like you need the single
quotes there to get the exclamation point to work.

Hope this helps,
Hugh
-- 
Saint Aardvark the Carpeted
[EMAIL PROTECTED]
Because the plural of Anecdote is Myth.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message



Re: Customizing /etc/motd

2003-02-13 Thread Cliff Sarginson
On Thu, Feb 13, 2003 at 05:31:08AM -0800, Saint Aardvark the Carpeted wrote:
 Colin J. Raven disturbed my sleep to write:
  Greetings all!
  I'd like to tweak /etc/motd to give ssh users a personalized login text.
 
 Printing the last time the user logged in appears to be part of login(1)
 itself, not /etc/motd.  I suppose you could always modify the source
 code to print the message you like, but an easier way would be to append
 something to /etc/profile:
 
 echo 'Welcome to FreeBSD, $USER!'
 
 $USER is the user's account name.  And it looks like you need the single
 quotes there to get the exclamation point to work.
 
You could go one step further in user friendliness (sic) .. put the
person's nickname in the GECOS field of the password file, find
out the time of day and when your boss logins at 8:30 a.m. it could say

Good Morning lame-brain loser. What's the matter ? Couldn't sleep last night ?
Or were you too busy moon-howling ?

:)

-- 
Regards
   Cliff Sarginson 
   The Netherlands

[ This mail has been checked as virus-free ]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message