Unix/Linux Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Esc-k and command history

Solaris


Reply    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
cptkirkh's Unix or Linux Image
cptkirkh cptkirkh is offline
Registered User
 
Join Date: Aug 2016
Last Activity: 4 October 2017, 12:51 PM EDT
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Esc-k and command history

Good afternoon, I am an Oracle DBA that is a bit stumped on the sudo and viewing historical commands. In the past on solaris 10 we would all first use our own username and password to putty to our unix box. Then in our /home/"my username"/.profile file it is setup to use sudo -u oracle for us to be able to utilize the oracle account on the unix box. When we did if we ever did esc-k we would only see our own command history. Now on Solaris 11 it seems that we see everyone's history commands when we perform exactly the same steps as before. Any clue on where and why this has changed? Also any suggestions on how to fix it? Thanks.
Sponsored Links
    #2  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
Corona688's Unix or Linux Image
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 11 December 2017, 5:38 PM EST
Location: Saskatchewan
Posts: 22,546
Thanks: 1,159
Thanked 4,286 Times in 3,955 Posts
Everyone's history is appearing in the same account? That's a bit odd. Is everyone using the same account?
Sponsored Links
    #3  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
rbatte1's Unix or Linux Image
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 12 December 2017, 10:44 AM EST
Location: Lancashire, UK
Posts: 3,407
Thanks: 1,477
Thanked 669 Times in 602 Posts
Is this a mis-type? For me, sudo -u oracle would try to run the trailing command as user oracle, but you seem to not have one.

Do you actually sudo -u oracle bash or something else? If you become the user oracle then you will share the command history unless there is something in a profile that changes the history file pointer to be based on the real user on the Solaris 10 server.


On the old server, what exactly do you do?

What is the value of $HISTFILE on the old & new servers when you are being oracle?



I hope that this helps,
Robin
    #4  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
cptkirkh's Unix or Linux Image
cptkirkh cptkirkh is offline
Registered User
 
Join Date: Aug 2016
Last Activity: 4 October 2017, 12:51 PM EDT
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
yes i am sorry i left out the part of ksh. When you echo $HISTFILE it returns blank on both so it is not set. I don't want the history file to be pointed back to Solaris 10 i just each to have its own history. So if after i run sudo -u oracle ksh and then execute a file to run the . /home/oracle/.profile can i put a command to point back to my own history file?
Sponsored Links
    #5  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 12 December 2017, 12:37 PM EST
Location: Aachen, Germany
Posts: 11,787
Thanks: 339
Thanked 3,659 Times in 3,357 Posts
In bash, there's a variable $SUDO_USER which you might want to evaluate. Not sure how this works in ksh, though.
Sponsored Links
    #6  
Old Unix and Linux 10-04-2017   -   Original Discussion by cptkirkh
jim mcnamara's Unix or Linux Image
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 12 December 2017, 12:21 PM EST
Location: NM
Posts: 11,249
Thanks: 577
Thanked 1,121 Times in 1,033 Posts
Check to see what oracle's default shell is -Look in /etc/passwd


Code:
grep oracle /etc/passwd

Let us know - it should be ksh88.
Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
The history command: See other users command history iamnew2solaris UNIX for Dummies Questions & Answers 1 09-24-2011 05:56 PM
using command history bruno69 UNIX for Dummies Questions & Answers 1 01-22-2011 08:31 AM
need help in history Command ali560045 Shell Programming and Scripting 2 08-08-2008 04:33 AM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 05:37 AM
History Command jack UNIX for Dummies Questions & Answers 2 08-01-2001 02:01 PM



All times are GMT -4. The time now is 01:40 PM.