1.:wq 进行保存退出,退出不了,一直提示
E212 can’t open file for writing
命令: sudo su 切换至超级用户
1.2.常用命令
退出命令是,按ESC键 跳到命令模式,然后输入:q(不保存)或者:wq(保存) 退出。
:w 保存文件但不退出vi
:w file 将修改另外保存到file中,不退出vi
:w! 强制保存,不推出vi
:wq 保存文件并退出vi
:wq! 强制保存文件,并退出vi
:q 不保存文件,退出vi
:q! 不保存文件,强制退出vi
2.selinux
2.1 关闭selinux
vi /etc/selinux/config
SELINUX=disabled
2.2临时关闭selinux
setenforce 0
2.3 查看selinux的状态
getenforce
3.git err
fatal: unable to access ‘https://github.com/john/git-Training.git/’: Peer reports incompatible or unsupported protocol version.
[john@doe git-Training]$ sudo yum update -y nss curl libcurl
3.yum:Loaded plugins: fastestmirror
fastestmirror是yum的一个加速插件,这里是插件提示信息是插件不能用了。禁用掉,先yum了再说。
3.1.修改插件的配置文件
vi /etc/yum/pluginconf.d/fastestmirror.conf
enabled = 1//由1改为0,禁用该插件
3.2.修改yum的配置文件
vi /etc/yum.conf
plugins=1//改为0,不使用插件
4. yum:Existing lock /var/run/yum.pid: another copy is running as pid 3605.
yum只能支持一个例程运行,所以如果有一个例程已经在运行,其他的必须等待该进程退出释放lock
rm -f /var/run/yum.pid
5. yum update:升级所有包同时也升级软件和系统内核
yum upgrade:只升级所有包,不升级软件和系统内核
测试样例:
升级前
系统版本: centos5.5
内核版本: 2.6.18-194.el5
yum upgrade 升级后,只升级所有包,不升级软件和系统内核
系统版本: centos5.7
内核版本: 2.6.18-194.el5
yum update 升级后,升级所有包同时也升级软件和系统内核
系统版本: centos5.7
内核版本: 2.6.18-238.el5
6. 删除directory
rm -rf cb删除:-r是递归处理,就是一层一层的删;-f是强制删除。
7. 更新阿里源
wget http://mirrors.aliyun.com/repo/Centos-7.repo
更改文件名称
mv Centos-7.repo CentOS-Base.repo
执行更新命令
yum clean all
yum makecache
yum update
8. ip add和配置文件中的名字不一样-》更换配置文件的名字
更换mac地址(关机后的VMware里)
linux下的NetworkManager服务,解决service network restart 闲置网卡报错问题
重启网卡:service network restart,报出错误
停止服务:service NetworkManager stop
移除开机启动:chkconfig NetworkManager off
重启网卡:service network restart,无错误
以上桥接模式下
9.pip uninstall opencanary -y
没成功(路径不对),蜜罐客户机就offline(之前的痕迹没清除干净吧)