美文网首页
CentOS7常用操作

CentOS7常用操作

作者: Jinx菜鸟之路 | 来源:发表于2020-11-09 10:12 被阅读0次

1.CentOS卸载firewalld防火墙安装iptables

CentOS 7卸载firewalld防火墙命令

systemctl disable firewalld

systemctl stop firewalld

systemctl mask firewalld

systemctl disable firewalld.service

CentOS 7安装iptables防火墙

yum install iptables -y

yum install iptables-services -y

systemctl enable iptables

systemctl enable iptables.service

systemctl start iptables.service  #启动服务

systemctl status iptables.service  #运行状态查询

systemctl restart iptables.service  #重启服务

service iptables save  #保存防火墙规则

2.修改sshd配置

修改ssh配置文件sshd_config

vi /etc/ssh/sshd_config

防火墙放行

向SELinux中添加修改的SSH端口

yum provides semanage

yum -y install policycoreutils-python

查询当前 ssh 服务端口:semanage port -l | grep ssh

向 SELinux 中添加 ssh 端口:semanage port -a -t ssh_port_t -p tcp 22345 

重启 ssh 服务:systemctl restart sshd.service

测试成功后,把22端口注释掉即可

3.新增用户

4. 解压缩

tar -zcvf tomcat.tar.gz --exclude=tomcat/logs tomcat

tar -zxvf tomcat.tar.gz

5. 调整history

vi /etc/profile

HISTSIZE=100000

HISTTIMEFORMAT='%F %T '

export HISTSIZE HISTTIMEFORMAT

source /etc/profile

相关文章

网友评论

      本文标题:CentOS7常用操作

      本文链接:https://www.haomeiwen.com/subject/hgvdbktx.html