bash history - each session in different file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers bash history - each session in different file
# 1  
Old 07-03-2009
bash history - each session in different file

Hello
How to configure, or where to have each session history in different file

Example: someone is connecting as root and at this time is creating file in which we have history of executed command
to server is connecting another user and is created another file with command executed by second user.
# 2  
Old 07-03-2009
HISTFILE is readonly - it controls the file used.
Bash Reference Manual: Bash History Facilities

I would consider setting HISTFILE to something during login, like
Code:
HISTFILE=/history_files/$USER.$(date +%Y%m%d:%H:%M)
readonly HISTFILE

The /history_files directory will need to be setup like /var/tmp - allow users to read & write & own files.

Code:
$ ls -ld /var/tmp
drwxrwxrwt 16 root sys 8192 Jul  3 17:54 /var/tmp

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

History with Session info

Hello Unix Gurus, I am in the need to capture the terminal info a command was executed from in the history. Currently history lists only the time and command, but does not list the terminal that can help associate the command to an individual. So my ask is - is there a way to capture/append... (3 Replies)
Discussion started by: abby007
3 Replies

2. OS X (Apple)

I have a backdoor in my OS X? This is what I found in my bash history

That's what appears at the beginning of my bash history (when you type "open .bash_history" in terminal) sudo -k export PS1="";sudo echo AUTHENTICATED;echo RETRY exit export PS1="" sudo echo AUTHENTICATED ; sudo -k ; echo AUTHENTIKILL ; echo PROCESSEDAUTHENTICATION sudo ls;sudo -k;exit;echo... (1 Reply)
Discussion started by: jonathansmith
1 Replies

3. Red Hat

Current Session History

Dear All, I want to display the command related to current session in Redhat Linux 5. Below history command display all the command in ~/.bash_history file. $history My requirement is the command executed in my current session.I mean to say. Suppose after log in as root i executed ... (1 Reply)
Discussion started by: monojcool
1 Replies

4. Red Hat

Tracking All session history in one file

Dear All, I want to keep all the session history in one file,please help me out to configure so. Here is the test scenario- Suppose i have three client A,B and C tries to log in to one Server XA there session specific command and Clint IPADDRESS should get logged in one file...like ... (0 Replies)
Discussion started by: monojcool
0 Replies

5. UNIX for Dummies Questions & Answers

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (1 Reply)
Discussion started by: sriky86
1 Replies

6. Shell Programming and Scripting

Increase bash history size

Hi I am trying to increase the number of commands recorded in my .bash_history file. I followed what is indicated and have add to my .bashrc export HISTCONTROL=ignoreboth export HISTSIZE=1000000 export HISTFILESIZE=1000000 export HISTIGNORE='ls'but the .bash_history only contains 690... (5 Replies)
Discussion started by: louisJ
5 Replies

7. Shell Programming and Scripting

export bash history to file

Hi, I want to export bash history to a file, I used the following command history > /home/administrator/bashHistory But the exported file only contains commands with line number from 996 to the last one, How to export all the commands including commands before line 996? Thanks a lot.... (2 Replies)
Discussion started by: Roy987
2 Replies

8. UNIX for Advanced & Expert Users

History to Another file [local user history , but root access]

Hi all, My need is : 1. To know who , when , which command used. 2. Local user should not delete this information. I mean , with an example , i can say i have a user user1 i need to give all the following permissions to user1, : a. A specific directory other than his home... (3 Replies)
Discussion started by: linuxadmin
3 Replies

9. Shell Programming and Scripting

bash telnet session logging

I'm looking at allowing remote telnet into my server. like any security-minded administrator, I want to log what my users type on the telnet session. I'm using the script command to generate transcripts of the users session. I have /etc/profile set to automatically start the script command... (2 Replies)
Discussion started by: ramnet
2 Replies

10. Shell Programming and Scripting

starting a bash session as child process to another bash session from a process

Hi I want to do something that might sound strange. I have a code that in written in C and is executed at startup (it's a custom process). It occasionally calls some bash scripts. The process doesn't have any terminal associated with it. One thing I don't know how to do is to start a... (5 Replies)
Discussion started by: alirezan
5 Replies
Login or Register to Ask a Question