And automatic logout command history

Environment Variables location

System environment variables Location: / etc / profile

User environment variables Location: / home / usr

Modify the command history

Command history mechanism Shell environment to provide users with a great convenience, but it also poses a potential risk to the user. As long as access to the user's command history file, the user's command operation will glance, it is necessary to command history is automatically logged out.

bash terminal environment, the command history is recorded as 1000. HISTSIZE controlled variable, by modifying the / etc / profile file HSITSIZE variable values, can affect all users of the system.

First, check the current command history

And automatic logout command history

The figure above shows the six command history

The system configuration file / etc / profile

And automatic logout command history

And automatic logout command history

And automatic logout command history

And automatic logout command history

Configuration, display the history verification

And automatic logout command history

If no command history records, you can change the value to 0, but command history will have user-friendly operation, so the operation is more efficient to clear the history when you log off, this method is described below.

Control file into the user environment variables

And automatic logout command history

And automatic logout command history

You can write command

And automatic logout command history

Automatic logout

Automatic logout is also set in the environment variable file, the command: export TMOUT =

And automatic logout command history

And automatic logout command history

And automatic logout command history

After a successful automatic logout 30s

And automatic logout command history

Guess you like

Origin blog.51cto.com/14449536/2433001