Fc command does not display all commands history of a user
hi, i have an AIX6.1 machine and i modified a user's profile so that it creates history file for each ip address that connects with this user. the reason i did this is because more than 1 person connects with the same user so i want to keep track of command run by all of them. therefore, in the users profile i exported HISTFILE variable like this:
in this way, i created one history file in the user's home directory with the extension of the ip address that the user connected. i see that the files are created successfully but the problem is when i use the command:
to view the command history of the user it only shows the command history run by my ip address only. i cannot see the command history run by other ip addresses. is there a way to display all history? thank you
First thing first, as for fc command will display the contents of YOUR command history files. So, you either have to su to that user or run more or cat on the HISTFILE in order to read it.
Not sure how did you get the user id and ip using the HISTFILE you provided.
But you might find the below helpful in capturing username and its login IP.
If you fc command doesn't work, use more or cat to read the file
thank you guys for your replies. i already had a different history file for each ip address that a specific user is logged in the system. i did that similar with what ibmtech posted. but the problem is that when i connect with this user and run the
command i only see the history of my history file (with my ip address). so i guess the only way is what CarloM suggested. i must change the HISTFILE attribute of my environment and set it to the history file that i want to examine and then run the command
to see the history. thank you both
hi, i have an AIX6.1 machine and i modified a user's profile so that it creates history file for each ip address that connects with this user. the reason i did this is because more than 1 person connects with the same user so i want to keep track of command run by all of them. therefore, in the users profile i exported HISTFILE variable like this:
in this way, i created one history file in the user's home directory with the extension of the ip address that the user connected. i see that the files are created successfully but the problem is when i use the command:
to view the command history of the user it only shows the command history run by my ip address only. i cannot see the command history run by other ip addresses. is there a way to display all history? thank you
I don't understand the problem.
If you want to see the actions taken by all users using this username, delete the HISTFILE setting you exported. All of the commands issued by this user will go into one history file and fc -t will show you the combined history.
If you want each IP address to have a separate history, obviously fc -t is only going to show you the history for the history file specified by HISTFILE in your current execution environment.
Either you want to share the history or you want separate histories. You can't have it both ways at the same time.
yes this is what i wanted to find out. if i have one history file as you said then i could not get the ip address of each command so i cannot know who is actually running the command because maybe 5 person can log in with 1 username. thats why i created separate history file for each ip address. i just wanted to know if i could do something to get all the commands of the user including the ip address of the user that runs the command. its fine i can export the specific history file that i want to check and then do
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)
Is it possible to find out the history of recently typed in commands of a particular user in a multi user system?
the history command expects a numeric argument with it. is it possible to find out the history o commands of a particular user say John_smith for example? (2 Replies)
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)
Hello every body,
Kindly inform me How Do i find out the time I executed a command previously on UNIX Solaris??
To be more specific and more clear about what i want to know is that I want a command the enables me to know the history and which command i run at this history/time.
FYI I used... (5 Replies)
Hi
We are sharing our envoirnment with our component teams. the plateform is SunOS 5.8 Generic_117350-41 sun4u sparc SUNW,Sun-Fire-V490.
All team logs in the domain with same user and perform activities.
Now for the system auditing purpose can somebody guide me how can I get the details when... (6 Replies)
Hi,
I can use history command in unix to view my last 50 commands. But how can I run the previous commands easily? Can history command help?
Firebird (2 Replies)