Last login details in banner

Friends!!
I need your help. Where can i change/set the last login details as below in aix 5.3. And how to do that to get the results as exactly below

login as: mbpops
mbpops@xx.28.3.24's password:
Last unsuccessful login: Mon Nov 22 14:32:27 GMT 2010 on ssh from 10.132.5.129
Last login: Mon Nov 22 14:44:54 GMT 2010 on ssh from 10.132.5.129

###########################################################################
# #
# #
# This computer system, its network and data contained therein is the #
# property of the xxxxxxxxxxxxxxxxxx Group. Access to this computer and #
# network is restricted to persons and programs authorised by the Group #
# only. Access by others is prohibited and unauthorised, and is wrongful #
# under law. Do not proceed if you are not authorised. Any unauthorised #
# access will be prosecuted to the fullest extent of the law. #
# #
# #
###########################################################################

Files Reference
utmp, wtmp, failedlogin File Format
Purpose

Describes formats for user and accounting information.
Description

The utmp file, the wtmp file, and the failedlogin file contain records with user and accounting information.

When a user attempts to logs in, the login program writes entries in two files:

    * The /etc/utmp file, which contains a record of users logged into the system.
    * The /var/adm/wtmp file (if it exists), which contains connect-time accounting records.

On an invalid login attempt, due to an incorrect login name or password, the login program makes an entry in:

    * The /etc/security/failedlogin file, which contains a record of unsuccessful login attempts.

The records in these files follow the utmp format, defined in the utmp.h header file.

Thanks frank_rizzo.
But my query is "i want set/display those bold information in my system. Where i need to make configurations.

ok . I misunderstood your request. I don't think that is possible but check the documentation on login.cfg.

Can any one help me out - pls.

Modify the /etc/motd: To include:

###########################################################################
#                                                                         #
#                                                                         #
# This computer system, its network and data contained therein is the     #
# property of the xxxxxxxxxxxxxxxxxx Group. Access to this computer and   #
# network is restricted to persons and programs authorised by the Group   #
# only. Access by others is prohibited and unauthorised, and is wrongful  #
# under law. Do not proceed if you are not authorised. Any unauthorised   #
# access will be prosecuted to the fullest extent of the  law.            #
#                                                                         #
#                                                                         #
###########################################################################

and you should be fine.

Hi manifestox,
Thanks for the reply. My query is, want to add the below output before /etc/motd displayed.

"Last unsuccessful login: Mon Nov 22 14:32:27 GMT 2010 on ssh from10.132.5.129
Last login: Mon Nov 22 14:44:54 GMT 2010 on ssh from 10.132.5.129"

How could i achieve it?.

Just to ask the obvious, you don't get the last login information right now?

When I log in I get exactly:

Using username "purdym".
This is a private computer facility.  Access to the facility must be
specifically authorized.  If you are not authorized, your continued
access and further inquiry expose you to criminal and/or civil
proceedings.

Authenticating with public key "imported-openssh-key" from agent
Last unsuccessful login: Sun Jul 25 07:44:34 CDT 2010 on ssh from miles_xp
Last login: Tue Nov 23 12:33:28 CST 2010 on /dev/pts/5 from miles_xp

The herald is my doing. The last three lines are printed from the SSH daemon. Are you asking how to get SSHD to display that information?

He wants to show it in highlighted/bold color which cannot be doing because this information ie being provided by the login program.

I got it to work, sometimes.

It does not work when I ssh from my PC, it works when I ssh from another server.

Add the ansi colour escape sequence to your SSHD banner file:

This is a private computer facility.  Access to the facility must be
specifically authorized.  If you are not authorized, your continued
access and further inquiry expose you to criminal and/or civil
proceedings.

^[[36;40;1m

Note that ^[[ is crontrol+v escape [

he is not using ssh and the login information is not in /etc/motd or banner file.

Maybe the OP can clarify:
How he is logging in...ssh? Rlogin?

What he wants to see.

And how he wants it formatted.

Thanks for the reply friends.
i am using both ssh & telnet friends. i want to display the unsuccessful login attempts and last login date, time details before the banner display. i don't want to do any formatting stuff friends. Hope u are understand y query.

i am confused. the OP shows already the that???

Apologize for the inconvenience friends. The sample o/p shared here is taken from somewhere in net. Now i need to set/configure the same for all my production systems.

you should be getting that message already. can you ensure that you don't have a .hushlogin file.

There is no .hushlogin.

kmvinay,

something is funny, you should be seeing that information already.

For SSH, I think the option you want is:

PrintLastLog yes

Verify that this is your sshd config file.

I suspect it won't help though, it sounds like something is suppressing the last login information for every service. I get last login information for every service I tried: ssh, rlogin, telnet.

You run AIX correct?
What does the entry in /etc/inittab look like for telnet?