关闭防火墙 (不关闭则远程访问会被拒绝)
因为CentOS7版本后防火墙默认使用firewalld,因此在CentOS7中关闭防火墙使用以下命令
systemctl disable firewalld # 禁止开机启动
查看防火墙状态: systemctl status firewalld.service
执行关闭命令: systemctl stop firewalld.service
执行开机禁用防火墙自启命令 : systemctl disable firewalld.service
启动:systemctl start firewalld.service
防火墙随系统开启启动 : systemctl enable firewalld.service
如果安装了iptables-service,也可以使用下面的命令
yum install -y iptables-services # 安装iptables
service iptables stop # 关闭防火墙
service iptables status # 查看防火墙状态
启动一个服务:systemctl start firewalld.service
关闭一个服务:systemctl stop firewalld.service
重启一个服务:systemctl restart firewalld.service
显示一个服务的状态:systemctl status firewalld.service
在开机时启用一个服务:systemctl enable firewalld.service
在开机时禁用一个服务:systemctl disable firewalld.service
查看服务是否开机启动:systemctl is-enabled firewalld.service
查看已启动的服务列表:systemctl list-unit-files|grep enabled
查看启动失败的服务列表:systemctl --failed
3.配置firewalld-cmd
用yum 安装salt-master出现未找到软件 # No package salt-master available
首先安装epel
#wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
#rpm -ivh epel-release-latest-7.noarch.rpm
#yum repolist ##检查是否已添加至源列表
yum -y install salt-master
yum安装软件出现用户取消而退出的解决办法
vim /usr/libexec/urlgrabber-ext-down
将/usr/bin/python改为/usr/bin/python2.7
vim /usr/bin/yum-config-manager
解决办法同上: #!/usr/bin/python换成 #!/usr/bin/python2.7
mysql的一些操作指令
1、systemctl start mysqld.service #启动mysql
2、systemctl status mysqld.service #查看mysql的启动状态
3、mysql -uroot -p #进入mysql
CentOS 7.X 关闭SELinux
查看
[root@dev-server ~]# getenforce
Disabled
[root@dev-server ~]# /usr/sbin/sestatus -v SELinux status: disabled
永久关闭
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
设置后需要重启才能生效
centos 开启telnet服务
安装telnet服务
yum install telnet-server.x86_64
yum install telnet.x86_64
安装xinetd
yum install xinetd.x86_64
将xinted和telnet加入自启动服务
systemctl enable xinetd.service
systemctl enable telnet.socket
重启服务
systemctl start telnet.socket systemctl start xinetd
设置静态ip
vim /etc/sysconfig/network-scripts/网卡名字
IPADDR=192.168.1.122 #本机地址 NETMASK=255.255.255.0 #子网掩码 GATEWAY=192.168.1.1 #默认网关
ONBOOT="yes"
systemctl restart network # 重启网卡
/var/run/yum.pid 已被锁定,PID 为
直接在终端运行 rm -f /var/run/yum.pid 将该文件删除,然后再次运行yum