环境变量修改 关闭防火墙

查看系统版信息

查看系统
[root@oldboyznb ~]# cat /etc/redhat-release /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
CentOS Linux release 7.6.1810 (Core)
[root@oldboyznb ~]# ll /etc/redhat-releas /etc/centos-release
ls: cannot access /etc/redhat-releas: No such file or directory
-rw-r--r--. 1 root root 38 Nov 23 21:16 /etc/centos-release

查看内核
[root@oldboyznb ~]# uname -r
3.10.0-957.el7.x86_64

[root@oldboyznb ~]# uname -m
x86_64

32位
i386 i686

在root 用户下修改普通用户密码
[root@oldboyznb ~]# echo 123456|passwd --stdin maomao
Changing password for user maomao.
注:只有root用户可以passwd修改其他用户密码 --stdin(从管道获取密码)

环境变量 :
1 系统设置 创建 显示或配置系统特性
2 名字大写
3可以在 Linux 下面随处使用一般含义一样

常见的环境变量
UID 当前用户uid信息
PATH 存放的是命令的位置 ‘
[root@oldboyznb ~]# echo 取变量内容的符号
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
$ 取变量内容的符号

修改环境变量过程
Ps1 环境变量
[root@oldboyznb ~]# echo
1 临时修改 重新登录系统失效
export PS1="[[\e[34;1m]\u@[\e[0m][\e[32;1m]\H[\e[0m] [\e[31;1m]\w[\e[0m]]\ "

[root@oldboyznb ~]#source /etc/profile

3检查
[root@oldboyznb ~]echo

SELinux· 增强型Linux ——限制root和·普通用户权限
1如何关闭 操作前备份操作后检查
[root@oldboyznb ~]cp /etc/selinux/config /etc/selinux/config.bak

永久—修改配置文件
vim /etc/selinux/config.

3 # SELINUX= can take one of these three values:
4 # enforcing - SELinux security policy is enforced.
5 # permissive - SELinux prints warnings instead of disabled.
6 # disabled - No SELinux policy is loaded.
7 SELINUX=enforcing
SELINUX=写入命令
SELINUX=enforcing SELinux开启
SELINUX=permissive SELinux关闭 还会有警告信息
SELINUX=disabled SELinux彻底关闭

Grep过滤查看是否修改正确
[root@oldboyznb ~] grep '=disabled' /etc/selinux/config
SELINUX=disabled
临时修改 命令修改
[root@oldboyznb ~]# getenforce
Disabled

[root@oldboyznb ~]# getenforce
Disabled
[root@oldboyznb ~]# setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]
[root@oldboyznb ~]# setenforce 0
setenforce: SELinux is disabled

关闭防火墙
Firewalld(c7) iptables(c6)
作用:根据设置规则 准许/禁止用户进出·
开启防火墙 ——服务器有公网ip地址
关闭服务器——服务器没有公网ip 局域网、
——并发量太高
关闭过程
临时:
[root@oldboyznb ~]# systemctl stop firewalld

[root@oldboyznb ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
检查是否成功
[root@oldboyznb ~]# systemctl status firewalld
Disabled 显示关闭
开启防火墙
[root@oldboyznb ~]# systemctl restart firewalld.service

配置及修改yum源
打开镜像网站
阿里云 清华——找到centos 帮助 复制命令行

你可能感兴趣的:(环境变量修改 关闭防火墙)