How to make each login shell history independent for same account?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to make each login shell history independent for same account?
# 1  
Old 03-28-2015
How to make each login shell history independent for same account?

Hello All,
Many developers in our company use same application account to log in Linux Box for code development, how can i redirect my log in shell history to a different file to avoid history being shown to others or accidentally execute the same command which i or others executed?

Thank you.
# 2  
Old 03-29-2015
How history is handled varies from shell to shell (and you didn't bother telling us which shell you're using).

Look at the man page for your shell and search for the description on that page for a description of the HISTFILE variable. (Note that changing HISTFILE might not affect the current shell execution environment; but if you export it and exec a new shell, it should be effective in that environment.)

If you don't find HISTFILE, look for history file or history to find out how to set the history file for your shell.
# 3  
Old 03-29-2015
My bad we log in to CSH and then change the shell to KSH and do the coding. I looked at the man page of HISTORY it talks more about events and other stuff, do not understand how to change the behavior, could you please throw some light.

Thank you.
# 4  
Old 03-29-2015
I didn't say to look at the HISTORY man page; I said to look at the man page for your shell (ksh in this case) and look for the HIStORY environment variable on that man page.

If you're users are logging in to an environment running csh and they manually invoke ksh, the simple thing to do is something like the following while you are still in csh:
Code:
setenv HISTFILE=$HOME/.ksh_history.username
exec ksh

where username is the real name of the user logging in to this shared environment; not the shared account name everyone is logging into on this machine. That will give each user a separate history file (and keep track of the commands that user has used across logins).
This User Gave Thanks to Don Cragun For This Post:
# 5  
Old 03-29-2015
Thank you it worked. I am trying to put the same/below in a file .vimrc and sourced the file, however when i vi the file it is not showing color scheme i wanted and i have to explicitly define the color scheme after i vi the file.Is there any way i can make this work? i am using KSH.

.vim.rc
Code:
set syntax on
set colorscheme murphy
set hlsearch on
HISTFILE=/tmp/.ksh_history.$$

Sourcing
. ./.vim.rc
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

1 VPS with 2 IP addresses. How to make them independent?

Code: auto ens3 iface ens3 inet static address 46.xx.xxx.1x7 netmask 255.255.252.0 broadcast 46.38.xxx.255 gateway 46.xx.xxx.1 auto ens3:0 iface ens3:0 inet static address 188.xx.xx.xx5 netmask 255.255.255.255 I want the... (1 Reply)
Discussion started by: oshihari
1 Replies

2. IP Networking

1 VPS with 2 IP addresses. How to make them independent?

I have this in /etc/network/interfaces: auto ens3 iface ens3 inet static address 46.xx.xxx.1x7 netmask 255.255.252.0 broadcast 46.38.xxx.255 gateway 46.xx.xxx.1 auto ens3:0 iface ens3:0 inet static address 188.xx.xx.xx5 netmask... (0 Replies)
Discussion started by: Douro
0 Replies

3. AIX

User Account Login Login on your AIX server

I want to learn AIX. I would like to find someone who would be willing to give me a login to their AIX home lab server. My intent is to poke around and discover the similarities and differences of AIX compared to other *NIXs. I am a UNIX admin so I can think of what some immediate concerns may... (1 Reply)
Discussion started by: perl_in_my_shel
1 Replies

4. UNIX for Dummies Questions & Answers

User account with no login shell

Hi All, I was reading a tutorial for Installing Tomcat on Linux machine. (http://www.puschitz.com/InstallingTomcat.html) Here the author had mentioned that: For security reasons I created a user account with no login shell for running the Tomcat server. My question is: 1. What is a User... (6 Replies)
Discussion started by: jw_amp
6 Replies

5. Linux

How to find remote Linux box login account without login in to that box?

Hi, How to find remote Linux box login account without login in to that box? I don't have login account at my remote Linux box. But I need who are all having login account. How do I findout? Thanks, --Muthu. (3 Replies)
Discussion started by: Muthuselvan
3 Replies

6. Solaris

make an sftp account

Hi All, My application is connecting to a no of sites to get or put files. one script is using sftp user1@host1 to log into the account to put some files over there.But some other scripts are connecting to some other sites using ftp host2 user user2 passwd inside the script.But I... (1 Reply)
Discussion started by: megh
1 Replies

7. AIX

Can't login root account due to can't find root shell

Hi, yesterday, I changed root's shell in /etc/passwd, cause a mistake then I can not log in root account (can't find correct shell). I attempted to log in single-mode, however, it prompted for single-mode's password then I type root's password but still can not log in. I'm using AIX 5L version 5.2... (2 Replies)
Discussion started by: neikel
2 Replies

8. UNIX for Dummies Questions & Answers

Setting an account to be a non-login account automatically?

Is there a way to easily change an account to be a non login account (NP in the shadow) file? I know I can just edit the file but that is not what we want to do. We use access control software and want to provide a way to set an account to be non-login using simple commands that can be mapped... (0 Replies)
Discussion started by: LordJezo
0 Replies

9. News, Links, Events and Announcements

DARPA contestants make robotic history

DARPA contestants make robotic history http://news.com.com/Driverless+robots+reach+milestone+in+DARPA++race/2100-11394_3-5891793.html?tag=nl (3 Replies)
Discussion started by: Neo
3 Replies

10. UNIX for Dummies Questions & Answers

login history log file?

hi, i am the administrator of my sun solaris 8 server. i want to keep a log file for users who have login. example: in the end of the day, i want to open file that tells me during these days, what user, from which IP address, and from what time to time has login. please tell me how should... (4 Replies)
Discussion started by: champion
4 Replies
Login or Register to Ask a Question