The implementation principle of Linux fortress machine

Source: Internet
Author: User

Fortress machine


Fortress Machine Login

Available via Google Authenticator

Here's a nice article: http://www.osyunwei.com/archives/9045.html



Command audits

This article provides 2 records in the following ways:

The first focus on session recording, can be played, can record vim inside the editing situation.

The second is a record that focuses on the command line.


A. use Termrecord to record and replay terminal sessions on Ubuntu (mostly user-recorded)

Termrecord is an open source tool written in the Python language that can record terminal sessions as a standalone HTML file. Because an HTML-formatted output file is a standalone file, anyone can use a cross-platform web browser to place the recorded terminal session back and forth.

1. Install PIP

sudo apt-get install Python-pip

2, installation Termrecord

sudo pip install Termrecord

3. recording Terminal session with Termrecord

Termrecord-o/path/filename_html# stop Recording, type Exit to exit.

4 . Open the HTML output in a Web browser.


Can be placed in/etc/profile:

if [[$UID-ge 499]]; Then mkdir-p ~/.audit/data exec/usr/bin/termrecord-o ~/.audit/data/${user}-${uid}-${audit_time}.htmlfi


B, a command record on the line.

Export prompt_command= "histtimeformat=\"%y%m%d%h%m%s \ "; auditdate=\$ (date-d today + "%y%m%d%h%m%s"); execdate=\$ (History 1 | awk ' {print \$2} '), if [\ $AUDITDATE-eq \ $EXECDATE];then builtin history 1 >>/var/log/audit . Log fi &>/dev/null "


This article is from the "Cheat One World de blog" blog, please be sure to keep this source http://qiyishi.blog.51cto.com/5731577/1901844

The implementation principle of Linux fortress machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.