- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- lastb command security
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 12:45 AM
09-18-2009 12:45 AM
lastb command security
# ll /usr/bin/lastb
-r-xr-xr-x 2 root sys 16384 Nov 9 2000 /usr/bin/lastb
OK, but in terms of Users can mistakenly enter their passwords as a username when logging in what will happens:
# lastb -R | more
rr oot pts/ta 192.168.xx.x Tue Sep 15 22:04
a1b1c2 pts/tb 192.168.xx.x Mon Sep 14 18:57
1a1b1c pts/ta 192.168.xx.x Mon Sep 14 16:57
the left column has some passwords , in my example a1b1c2 is probably password. So I am confused, and I think it needs to be careful about lastb maybe Admins can write a crontab script to trim /var/adm/btmp
from time to time . .
I there anybody knows anymore what I do not know ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 12:57 AM
09-18-2009 12:57 AM
Re: lastb command security
The lastb command searches backwards through the database file /var/adm/btmps to display bad login information. Access to /var/adm/btmps should be restricted to users with appropriate privileges (owned by and readable only by root) because it may contain password information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 01:11 AM
09-18-2009 01:11 AM
Re: lastb command security
# ll /var/adm/btmp
-rw-rw-rw- 1 root sys 60 Sep 13 03:00 /var/adm/btmp
weird?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 01:36 AM
09-18-2009 01:36 AM
Re: lastb command security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 01:50 AM
09-18-2009 01:50 AM
Re: lastb command security
Not really, it checks:
$ /usr/bin/lastb
lastb can be invoked only by root. Exiting ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 03:29 AM
09-18-2009 03:29 AM
Re: lastb command security
Not really, look at this one, user is ordinary user.
$ who am i
aydin pts/1 Sep 18 10:47
$ lastb -R
unknown gold:17233 servisnet Thu Sep 10 13:04
root pts/ta servisnet Wed Sep 9 17:41
root pts/ta servisnet Wed Sep 9 17:41
So, I confused that is this related with our server setup or generic problem ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 04:33 AM
09-18-2009 04:33 AM
Re: lastb command security
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 05:36 AM
09-18-2009 05:36 AM
Re: lastb command security
However, on my 11.23 system I get the message that lastb can only be run as root.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2009 09:12 PM
09-18-2009 09:12 PM
Re: lastb command security
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2009 02:59 AM
09-19-2009 02:59 AM
Re: lastb command security
This is a moot point. If you can read the file you can write your own lastb.
>on my 11.23 system I get the message that lastb can only be run as root.
Ah right, they fixed it there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2009 03:13 AM
09-19-2009 03:13 AM
Re: lastb command security
I will check this in my lab, because I do not have sudo servers I am responsible.
>Patrick:
I decided to modify permission to 600 on /var/adm/btmp in all servers, even though I am not sure how it happened? Apparently after rel. 11iv2 it is corrected .
>Bill:
What I am looking for with swverify ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2009 09:51 PM
09-19-2009 09:51 PM
Re: lastb command security
How many servers were bad, any good?
I'm not sure if this logging is on by default but perhaps if not, when the file was created, root didn't have umask set securely.
>Apparently after release 11iv2 it is corrected.
Only lastb(1) was corrected, not the underlying security permissions on the file.
>What I am looking for with swverify?
Run: swverify \*
Then look for bad permissions on files/directories.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 01:29 AM
09-21-2009 01:29 AM
Re: lastb command security
20 servers in different locations have same problem.
> " : when the file was created, root didn't have umask set securely.
Probably, I am not sure ?
> " : Only lastb(1) was corrected, not the underlying security permissions on the file.
So , maybe it is better, both of /var/adm/btmp
and /usr/bin/lastb
must have 600 privilege ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 02:55 AM
09-21-2009 02:55 AM
Re: lastb command security
Only the file needs it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 03:52 AM
09-21-2009 03:52 AM
Re: lastb command security
So , maybe it is better, both of /var/adm/btmp
and /usr/bin/lastb must have 600 privilege ?
Not unless you don't want to run 'lastb'. After all, '/usr/bin/lastb' needs to be executed :-)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2009 04:10 AM
09-21-2009 04:10 AM
Re: lastb command security
IMHO Hakki has a very valid concern but it is two-fold.
The first part, some lastb components being accessible by 'normal' users is surely a bad setup.
The second part, that the attempted usernames show up in clear print to root users worries and had always bothered me.
For now I offer no solution, just a point to ponder.
Just like Hakki describes I have mistakenly entered my otherwise well-protected and well-chose, but shared amongst more system, password against the username prompt, instead of the password prompt. Clearly this is a user error. But it happens! Agreed?
While a system manager is implicitly trusted on the system being managed, this trust IMHO does NOT extent to other systems.
Whenever this happens to me, I'm very annoyed, and feel obliged to change my password. It would be nice to know that there was an option to NOT have the attempted username stored in clear print (only if it is a valid passwd entry?)
Admittedly this would reduce the ability for a system manager to assist users who repeatedly fat-finger or are mistaken about the username to use, but that's a price I would be willing to pay to be able to say that I can not have possibly seen a users passwords, that the system does not record potential passwords, even when fat-fingerd.
Like I said... just a thought!
Hein.