- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: re: root shell history
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
Discussions
Discussions
Forums
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
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-09-2005 02:53 AM
тАО06-09-2005 02:53 AM
how do I enable the shell history for the root user?
setting up a new HPUX RP3440 server and can't seem to figure this one out.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 02:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 02:57 AM
тАО06-09-2005 02:57 AM
Re: re: root shell history
# echo $SHELL
/sbin/sh
# set -o vi
add this to your root .profile
EDITOR=vi
PS1="$(hostname):\$PWD\# "
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
HISTSIZE=1000
export EDITOR HISTFILE PS1 HISTSIZE
Regards,
Robert-Jan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 02:58 AM
тАО06-09-2005 02:58 AM
Re: re: root shell history
HISTSIZE=500
HISTFILE=$HOME/.sh_history
export HISTFILE HISTSIZE
Do it in /etc/profile
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-09-2005 02:58 AM
тАО06-09-2005 02:58 AM
Re: re: root shell history
Just add these two lines in root's .profile.
export HISTFILE="/Path_to_file/$LOGNAME"
export HISTSIZE=1000
Remove hash from last line in .dtprofile file lying in root's home directory for xterm.
DTSOURCEPROFILE=true
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 03:19 AM
тАО06-09-2005 03:19 AM
Re: re: root shell history
after the previous modifications in the .profile:
touch /.sh_history
exit from the system and relog in it
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 05:36 AM
тАО06-09-2005 05:36 AM
Re: re: root shell history
HST=`hostname`
USR=`who -um | awk '{print $1}'`
NAME=`whoami`# Set History File
HISTFILE=/home/root/.sh_history_"${HST}"_"${USR}"-as-"${NAME}"_`date +%y%m%d.%
H%M%S_$$`
export HISTFILE
As this example shows, each history file has the $USER name associated with it plus they are time/date stamped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 05:40 AM
тАО06-09-2005 05:40 AM
Re: re: root shell history
# Set up logging
HISTFILE=${HOME}/.sh_history_`who am i|awk '{ print $1}'`
export HISTFILE
print -s "### login at `/usr/bin/date` ###"
#date >>$HISTFILE
HISTSIZE=50000
export HISTSIZE
As well, testing timestamping of all commands:
#trap to timestamp all commands
trap 'date "+# %c" | read -s' debug
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 05:47 AM
тАО06-09-2005 05:47 AM
Re: re: root shell history
export PS1="$LOGNAME@`hostname`:\$PWD# "
export HISTFILE=.sh_history
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-09-2005 08:55 PM
тАО06-09-2005 08:55 PM
Re: re: root shell history
Then, specially for root, donnot change the shell to a binary that is not in the root-filesystem. This shell is used in the single-user mode, where only the root-filesystem is available. Hence, donnot change this shell to something that needs libraries outside the root-filesystem...
(this is based on experience, it ruins your day if single-user does not work once you need it.)