- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: lastb command to wrk....for ordinary users...
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-14-2008 11:59 PM
09-14-2008 11:59 PM
i would like lastb command to wrk for ordinary users....
how do i make it available to all ordinary users...just for a exercise...
i know its a big security threat but still would like to do it...for my development server.....
hpux 11i v2...
root #/var/adm >ls -lrt *tmp*
-rwxr-xr-x 1 root sys 280 Jul 24 18:45 wtmpx
-rwxr-xr-x 1 root other 741780 Sep 15 13:10 btmp
-rwxr-xr-x 1 root other 11230048 Sep 15 13:10 btmps
-rwxr-xr-x 1 adm adm 5256840 Sep 15 13:26 wtmp
-rw-rw-r-- 1 adm adm 138667360 Sep 15 13:26 wtmps
rx46460...
Regards,
Tejas
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 12:12 AM
09-15-2008 12:12 AM
Re: lastb command to wrk....for ordinary users...
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 12:56 AM
09-15-2008 12:56 AM
Re: lastb command to wrk....for ordinary users...
This isn't just some "just for a exercise".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 01:04 AM
09-15-2008 01:04 AM
Re: lastb command to wrk....for ordinary users...
WE do have sudo installed....
but i wuld like to enable it for all users..without sudo ..
is it possible or not ????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 01:21 AM
09-15-2008 01:21 AM
Re: lastb command to wrk....for ordinary users...
if you change /var/adm/btmp file's permission it's possible. but as this file contain password information it is a security hole.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 01:25 AM
09-15-2008 01:25 AM
Re: lastb command to wrk....for ordinary users...
so what permissions i should be giving to it...
I know its a hole....but since its a development server...its fine....
Regards,
chindi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 01:37 AM
09-15-2008 01:37 AM
Re: lastb command to wrk....for ordinary users...
chown root:group_name /var/adm/btmp
chmod 660 /var/adm/btmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 01:45 AM
09-15-2008 01:45 AM
Re: lastb command to wrk....for ordinary users...
g1 /var/adm > ll *tmp*
-rw-rw---- 1 root sgr 741780 Sep 15 13:10 btmp
g1 /home/g1 > lastb -R|grep sud
g1 /home/g1 > id
uid=223(g1) gid=108(sgr)
root #/var/adm >lastb -R|grep sud|head -2
sud ssh:notty 10.1.4.190 Fri Sep 12 13:35
sud ftp 10.1.4.163 Thu Sep 11 16:26
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:24 AM
09-15-2008 02:24 AM
Re: lastb command to wrk....for ordinary users...
You should immediately remove execute permission from your ?tmp* files.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:24 AM
09-15-2008 02:24 AM
Re: lastb command to wrk....for ordinary users...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:29 AM
09-15-2008 02:29 AM
Re: lastb command to wrk....for ordinary users...
when i run lastb from that user i am getting
g1 /home/g1 > lastb
lastb can be invoked only by root. Exiting ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:39 AM
09-15-2008 02:39 AM
Re: lastb command to wrk....for ordinary users...
Then you'll have to make a copy of lastb and turn it into a setuid root executable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:49 AM
09-15-2008 02:49 AM
Re: lastb command to wrk....for ordinary users...
root #/usr/bin >ll /usr/bin/lastb
-rwsr-xr-x 2 bin bin 46772 Dec 22 2004 /usr/bin/lastb
even after this its not executing....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:51 AM
09-15-2008 02:51 AM
SolutionSo it is a very bad idea to circumvent these restrictions. You can give users a special alias called something like retrylist that is hardcoded to their personal login. That way, only bad logins using their correct username will be shown, something like this:
alias retrylist="sudo lastb -R $(id -un)"
You don't want users browsing all the failed logins...
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:53 AM
09-15-2008 02:53 AM
Re: lastb command to wrk....for ordinary users...
Of course not. To make a setuid root executable you have to use chmod and chown. There may be a specific ordering.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 03:14 AM
09-15-2008 03:14 AM
Re: lastb command to wrk....for ordinary users...
Its ok i have decided to leave it,since its a bit tedious one...and also a big security hole as pointed by all of u guys ( Bill,Dennis,Kenan).....
Regards,
Chindi....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 02:18 PM
09-15-2008 02:18 PM
Re: lastb command to wrk....for ordinary users...
While you can do this, it won't work:
$ ll lastb
-r-sr-xr-x 1 root sys 46764 Sep 15 15:12 lastb*
$ ./lastb
lastb can be invoked only by root. Exiting ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2008 08:36 PM
09-15-2008 08:36 PM