- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- .sh_history for root?
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
06-25-2003 05:52 AM
06-25-2003 05:52 AM
dumb question. How do you get .sh_history to work
for root? running 11i now, never had to set it before. it works for all users except root.
Thanks,
John
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:55 AM
06-25-2003 05:55 AM
Re: .sh_history for root?
Set it in .profile.
See other users .profile for how.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:55 AM
06-25-2003 05:55 AM
Re: .sh_history for root?
HISTSIZE=4096
HISTFILE=/.sh_history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:57 AM
06-25-2003 05:57 AM
Re: .sh_history for root?
remember also the
export EDITOR=vi
line, in addition to the others !
and the logout/login, better from another terminal, just in case you made the wrong change and are not being able to login...
HTH,
Massimo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:58 AM
06-25-2003 05:58 AM
Re: .sh_history for root?
in root' s .profile
export HISTFILE=/.sh_history
export HISTSIZE=100
Try
touch /.sh_history
. ./.profile
Good luck
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 05:58 AM
06-25-2003 05:58 AM
Re: .sh_history for root?
We put these entries in /etc/profile so that root and all other users get history access:
HISTFILE=/tmp/.sh_history.$(whoami)
export HISTFILE
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 06:03 AM
06-25-2003 06:03 AM
SolutionHISTFILE=$HOME/.sh_history
HISTSIZE=5000
This will implement it for all users.
Its important to save lots of data, especially for root. It helps me remember commands I don't use often and track down mistakes made by other people.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 06:27 AM
06-25-2003 06:27 AM
Re: .sh_history for root?
Some boxes have more than one root user, when there are some problems, we can review the .sh_history to check what's the wrong operation!
Fortunately, very small .sh_history can keep much history commands!!!!!!
-ux
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 06:50 AM
06-25-2003 06:50 AM
Re: .sh_history for root?
I used the /etc/profile method. works great.
added the following lines:
# add history stuff. 6/25/03 js.
HISTFILE=$HOME/.sh_history
HISTSIZE=5000
export HISTFILE
The confusing part for me was that it worked for users but not root. Nothing about history in user .profile, but it is in the .cshrc file for users even though user set to use ksh, it seems to be picking up the settings in .cshrc file.
Thanks for the help.
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 06:52 AM
06-25-2003 06:52 AM
Re: .sh_history for root?
You should be exporting HISTSIZE as well!
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 10:25 AM
06-25-2003 10:25 AM
Re: .sh_history for root?
If you have multiple admins who sign in as root, and you want to track them separately, then this is what we do:
# Set up logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
date >>$HISTFILE
export HISTFILE
HISTSIZE=500
export HISTSIZE
This creates a root history file for each person who su - to root.
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 02:14 AM
06-26-2003 02:14 AM
Re: .sh_history for root?
HISTFILE=~/.history_$LOGNAME
Far better to understand and faster...
Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 03:10 AM
06-26-2003 03:10 AM
Re: .sh_history for root?
Bill Hassell, sysadmin