- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- HPUX 10.20: Last User Login
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
12-12-2002 07:36 AM
12-12-2002 07:36 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:41 AM
12-12-2002 07:41 AM
SolutionIf you need a different way of doing it, change /etc/profile and /etc/csh.login so that at the end of each, it does a
touch $HOME/.lastlogin
This then creates a file called .lastlogin in each users home directory which you can then use to see when the last logged in.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:41 AM
12-12-2002 07:41 AM
Re: HPUX 10.20: Last User Login
You could try the last accessed date on their .profile but it's not foolproof.
wtmp *is* the logfile that contains this information but it's good practice to tidy it regularly so you could lose information.
How about amending /etc/profile or .profile to simply write the current date/time to a file based on ${LOGNAME}.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:45 AM
12-12-2002 07:45 AM
Re: HPUX 10.20: Last User Login
.sh_history file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:51 AM
12-12-2002 07:51 AM
Re: HPUX 10.20: Last User Login
I initially thought of that but it's going to be the time they logged out (or issued the last command if still logged in) rather than the time they logged in. It does match the requested criteria 'or the last date used' though.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:51 AM
12-12-2002 07:51 AM
Re: HPUX 10.20: Last User Login
# ls -ltu /home/chuckj/.profile
For future, you could write a script that gets executed via /etc/profile that creates a file with the data you require.
Or, if you want to do it for all users at this polint in time you could write a script that something like:
cd /home
for user in *.*
do
ls -ltu /home/chuckj/.profile >> /tmp/lastlogin
etc...
Chuck J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:52 AM
12-12-2002 07:52 AM
Re: HPUX 10.20: Last User Login
# ls -ltu /home/chuckj/.profile
For future, you could write a script that gets executed via /etc/profile that creates a file with the data you require.
Or, if you want to do it for all users at this polint in time you could write a script that something like:
cd /home
for user in *.*
do
ls -ltu /home/$user/.profile >> /tmp/lastlogin
etc...
Chuck J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2002 07:59 AM
12-12-2002 07:59 AM
Re: HPUX 10.20: Last User Login
In most sites, I run accounting even if I dont really use it. It keeps the /var/atm/*tmp files clean, as well as gets me info when I need it.
man accounting
It's relatively simple to setup.
change /etc/rc.config.d/acct file START_ACCT=0 to START_ACCT=1.
Run /usr/sbin/acct/turnacct on
The man pages will tell you what to run in cron, as well as other utilities you can use to extract data from reports.
The only thing the man pages dont tell you, is that you need to periodically clean up /var/adm/acct/sum, especially if your running daily accounting.
Accounting gets you lots of info, and in my opinion is worth setting up on all systems mainly because I have information when I need it for processes that ran, who the cpu hogs are, disk hogs, last logins, etc...
Regards,
Shannon