Solved

AIX /etc/security/lastlog not updated when login via ssh

Posted on 2003-11-13
10
4,110 Views
Last Modified: 2013-12-04
Security auditing has led us to find that on older AIX systems, accessing the system via ssh does NOT result in /etc/security/lastlog being updated. We have about 40 systems where this is a problem; a typical one has levels:
iswhbfocd# oslevel
4.2.1.0
iswhbfocd# ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
*
(Also happens with OpenSSH_2.5.2p2, OpenSSH_3.4p1,OpenSSH_3.7.1p1)
*
Can anyone point me to where/how I can enable logging to
lastlog? In later systems I can see a stanza in sshd.config:
*
PrintLastLog yes
# Specifies whether sshd should print the date and time when the
# user last logged in. The default is ``yes''.
*
Is this relevant?
Any comments would be appreciated.
Regards, Bernie.
0
Comment
Question by:bernie01
  • 5
  • 2
  • 2
  • +1
10 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 9745102
Did you build the openssh binary from soure or download the binary from
soemwhere?

If you built it from soure, when you run configure, did you include:
--with-lastlog=FILE will specify the location of the lastlog file.
./configure searches a few locations for lastlog, but may not find
it if lastlog is installed in a different place.

All your AIX boxes are running the same version of OS? and openssh is complied
with the same version of AIX? (if you complied on AIX 4.x, lastlog will not work under
AIX 5.x).
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9745175
You can also try to download a newer version of openssh binary package from
the following site (IBM), and install and test it out, it should work.

http://www-106.ibm.com/developerworks/eserver/articles/openssh_aix.html
0
 
LVL 24

Accepted Solution

by:
shivsa earned 100 total points
ID: 9753424
when  u installed it, did u mention
--with-lastlog=/etc/security/lastlog.


0
 

Author Comment

by:bernie01
ID: 9760255
Update: found that by changing /usr/local/etc/sshd_config parm #UseLogin no, change to UseLogin yes I can get an entry placed in /etc/security/lastlog on the systems with
OpenSSH_3.6.1p2.
*
But have found that the majority of these systems run
OpenSSH_2.5.2p2, SSH protocols 1.5/2.0,
and when I try the above fix on these boxes I get error:

spwhsms# su - webaeb
$ ssh localhost
webaeb@localhost's password:
Permission denied, please try again.
webaeb@localhost's password:
/dev/pts/4: 3004-004 You must "exec" login from the lowest login shell.
*
This version of Openssh was installed long, long before my time.  I am not sure whether the insallation was from binaries or source.  
0
 
LVL 38

Expert Comment

by:yuzh
ID: 9761024
If you don't know how the old version of openssh was installed (complied), and you want to make
it to work with lastlog.  It is time to uodate it now. (download the binary from IBM site, or download
the source and complie it yourself. I thinks bianary is easy way to do it.)
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 38

Expert Comment

by:yuzh
ID: 9761151
"spwhsms# su - webaeb
$ ssh localhost
webaeb@localhost's password:
Permission denied, please try again.
webaeb@localhost's password:
/dev/pts/4: 3004-004 You must "exec" login from the lowest login shell."

It looks like it is a bug in the older version of openssh:

http://www.derkeiler.com/Newsgroups/comp.security.ssh/2002-06/0055.html
http://www.derkeiler.com/Newsgroups/comp.security.ssh/2002-06/0056.html

Please consider to update your openssh.
0
 

Author Comment

by:bernie01
ID: 9767422
These systems are AIX 4.1.5 and 4.2.1 level. Looking at IBM's OpenSSH download pages I dont think there is a binary version for these old levels of AIX:
http://oss.software.ibm.com/developerworks/downloads/?group_id=108
*
For now we have altered the Audit tool to ignore these errors.  
0
 
LVL 38

Assisted Solution

by:yuzh
yuzh earned 200 total points
ID: 9768294
Well, if you are using 4.x, you endup have to compile it yourself, you only need to do it
in one box, and then create a tar ball to copy it to different boxes.
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 200 total points
ID: 9769971
There are a few versions of sshd around:
one from IBM Linux Affinity Toolbox, which writes lastlog, but fails to log in users oftenly.
one from IBM, in bff format, kind of too old to be secure.
another from www.bullfreeware.com, once you configure syslog, it writes some records on connections/sessions.
none writes that lastlog, i.e. no login sessions...( try UseLogin yes in sshd_config, this may help or just lock you off the system).

oslevel of 4.2.x.x is too old ....

what do you audited about $ cat . ??? writesrv ??? portmap ??? these are nasty&unavoidable
0
 
LVL 61

Expert Comment

by:gheist
ID: 9785860
no need to secure connections, for sure vulnerable portmapper is always on...
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
OfficeMate Freezes on login or does not load after login credentials are input.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now