Linux systems are very useful in the office environment. For example, in the command line that comes with the Linux system, you can record the behavior of employees using the computer. This article will introduce Linux's method of saving user operation records using script commands.
Encounter problems: The company has added operation and maintenance administrators. To ensure the security of the server and to confirm the problem when problems occur, it is necessary to record the behavior track of each server registrant.
Solving the problem: The linux script command is so powerful. Meet our needs. Script records the terminal session.
Operation steps:
I am a centos6.3 system, comes with a script command, if not, you need to install it manually.
vim /etc/profile
Add at the end:
if [ $UID -ge 1000 ]; then
exec /usr/bin/script -t 2"/mnt/log/script/$USER-$UID-`date +%Y%m%d%H%M`.date -a -f -q /mnt/log/script/$USER-$ UID-`date +%Y%m%d%H%M`.log
fi
The operation performed after the user logs in will be recorded to /mnt/log/script/*. In the log (the directory itself is defined according to the server directory), we can view it by more or vi.
I am here to record the user ID is greater than 1000, you can log back in to the user, operate some commands, view the generated file. Previous12Next page Total 2 pages
PyCharm is used for the functions of the general IDE, but many people have errors w
under Linux Node.js is a new language in Linux, and Node.js express is some default template. Of co
When using a computer, we hope to recover important files that have been accidental
When the name of the folder has a space, it can be easily deleted under Windows. Ho
Linux System Using Docker to Develop Django Projects
Steps for installing Tecplot under Linux
What should I do if the Linux system formats the partition and prompts Could not start /dev?
How to use rz/sz tool for file transfer in Linux
Ubuntu14.04 does not support U disk exfat format how to do?
How to install and use Sphinx in Linux system
Ubuntu install Texmaker FAQ summary
How to use the read command under Linux
Quickly clean up the trash win7 has a trick
Meitu Xiu Xiu produces panoramic effect
Network IP and DNS settings in Win 7 operating system
Microsoft Windows Vista technical support only until 2012
Microsoft: Win8 marks the re-birth of the operating system
Steps to uninstall IIS information service in Win7
WinXP drive icon is missing how to get back?
Microsoft pauses Win10 PC preview push to prepare UUP update method
External evaluation of Windows 8 upgrades should be done a number of improvements
How to remove the uninstall application from Win10? Win10 uninstall application operation method