运维操作管理理念
理念一:唯有控制才能真正解决问题
审计是事后行为,从来没有事前审计一说
审计可以发现问题,但是无法防止问题发生
只有在事前严格控制,才能从源头真正解决问题
理念二:系统账号无法确认用户身份
系统账号的作用只是区分工作角色
多人共用一个系统账号是合理的
运维人员的流动不应影响系统账号
理念三:人为操作难免会出问题
人有失手,马有失蹄
不怕出问题,就怕出问题找不到原因
只要机器能做的,就不要人做
Gate One 安装和使用
官方使用手册: http://liftoff.github.io/GateOne/
1.安装Gateone:
git clone https://github.com/liftoff/GateOne.git
cd GateOne
python setup.py install
#也可以用目录里面的docker来构建
docker build -t wmj/gateone:v1 /root/GateOne/docker/
2.启动Gateone:
# gateone #第一次启动会生成配置文件
https://172.16.2.241/ 直接通过https访问
3.命令行回放日志文件:
cd /var/lib/gateone/users/ANONYMOUS/logs/ #默认日志存放目录
/root/GateOne/gateone/applications/terminal/logviewer.py --flat 20170425170036224259-10.0.200.6.golog
4.嵌入GateOne:
# /root/GateOne/gateone/tests/hello_embedded #这是一个Demo目录
# ./hello_embedded_world.py --address=0.0.0.0 --port=6060
https://172.16.2.241:6060/ #访问Demo
# 修改配置文件,让gateone允许所有ip和关闭验证,这样才能嵌入。
vim /etc/gateone/conf.d/10server.conf
"origins": ["*"],
"auth": "None",
5.简单嵌入html脚本:
下面的IP地址要改成你自己的gateone服务器地址
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="Generator" content="EditPlus®">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>Document</title>
</head>
<body>
<!-- Include gateone.js somewhere on your page -->
<script src="https://172.16.2.241/static/gateone.js"></script>
<!-- Decide where you want to put Gate One -->
<div id="gateone_container" style="position: relative; width: 60em; height: 30em;">
<div id="gateone"></div>
</div>
<!-- Call GateOne.init() at some point after the page is done loading -->
<script>
window.onload = function() {
// Initialize Gate One:
GateOne.init({url: 'https://172.16.2.241/'});
}
</script>
<!-- That's it! -->
</body>
</html>