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

👤 Login to reply

    #1  
Old 10-04-2017
cptkirkh cptkirkh is offline
Registered User
 
Join Date: Aug 2016
Last Activity: 5 June 2018, 3:24 PM EDT
Posts: 7
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 10-04-2017
Corona688 Corona688 is offline Forum Staff  
Mead Rotor
 
Join Date: Aug 2005
Last Activity: 20 July 2018, 3:26 PM EDT
Location: Saskatchewan
Posts: 22,727
Thanks: 1,194
Thanked 4,351 Times in 4,006 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 10-04-2017
rbatte1 rbatte1 is offline Forum Staff  
Root armed
 
Join Date: Jun 2007
Last Activity: 20 July 2018, 11:57 AM EDT
Location: Lancashire, UK
Posts: 3,588
Thanks: 1,594
Thanked 706 Times in 633 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 10-04-2017
cptkirkh cptkirkh is offline
Registered User
 
Join Date: Aug 2016
Last Activity: 5 June 2018, 3:24 PM EDT
Posts: 7
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 10-04-2017
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 21 July 2018, 12:24 PM EDT
Location: Aachen, Germany
Posts: 13,082
Thanks: 452
Thanked 4,017 Times in 3,693 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 10-04-2017
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 21 July 2018, 1:18 PM EDT
Location: NM
Posts: 11,441
Thanks: 638
Thanked 1,176 Times in 1,082 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
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 04:56 PM
using command history bruno69 UNIX for Dummies Questions & Answers 1 01-22-2011 07:31 AM
need help in history Command ali560045 Shell Programming and Scripting 2 08-08-2008 03:33 AM
command history vikasdeshmukh UNIX for Dummies Questions & Answers 3 11-14-2001 04:37 AM
History Command jack UNIX for Dummies Questions & Answers 2 08-01-2001 01:01 PM



All times are GMT -4. The time now is 09:05 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password





Not a Forum Member?
Forgot Password?