1.查看系统内核信息
cat /etc/redhat-release /etc/centos-release
ll /etc/redhat-release /etc/centos-release
2.内核 信息
uname -r 查看系统内核
uname -m 只想查看多少位系统
useradd xxx添加用户名
passwd xxx 添加用户密码
x.86—64 64位系统
i386 i686 32位系统
设置用户密码
echo xxxx |passwd --stdin 目录xxx
环境变量:
【1】系统设置 创建 显示 或配置系统特性
【2】名字大写
【3】可以在linux下面随意使用 一般含义一样
常见的环境变量
UID 当前用户uid信息
PATH存放的命令的位置/路径
echo "
2.永久-写入文件/etc/profile 与生效
[root@oldboyedu59 /etc/sysconfig]# tail -1 /etc/profile
export PS1="[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$ "
[root@oldboyedu59 /etc/sysconfig]# source /etc/profile
3.检查
[root@oldboyedu59 /etc/sysconfig]# echo $PS1
[\[\e[34;1m\]\u@\[\e[0m\]\[\e[32;1m\]\H\[\e[0m\] \[\e[31;1m\]\w\[\e[0m\]]\\$
关闭selinux
操作前备份 操作后检查
cp xx xx
永久
修改配置文件
临时
永久修改配置文件
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彻底关闭
[root@oldboyedu59 ~]# grep '=disabled' /etc/selinux/config
SELINUX=disabled
临时 查看selinux状态
[root@oldboyedu59 ~]# getenforce
Disabled
[root@oldboyedu59 ~]# getenforce
Disabled
[root@oldboyedu59 ~]# setenforce
usage: setenforce [ Enforcing | Permissive | 1 | 0 ]
[root@oldboyedu59 ~]# setenforce 0
setenforce: SELinux is disabled
关闭防火墙
[root@oldboyedu59 ~]# systemctl stop firewalld
[root@oldboyedu59 ~]#
[root@oldboyedu59 ~]#
[root@oldboyedu59 ~]#
[root@oldboyedu59 ~]# 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@wuxin-123 ~]# systemctl restart firewalld.service
* (pkttyagent:103429): WARNING **: 11:29:43.184: Unable to register authentication agent: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.106" (uid=0 pid=103429 comm="/usr/bin/pkttyagent --notify-fd 5 --fallback ") interface="org.freedesktop.PolicyKit1.Authority" member="RegisterAuthenticationAgentWithOptions" error name="(unset)" requested_reply="0" destination=":1.2" (uid=999 pid=6336 comm="/usr/lib/polkit-1/polkitd --no-debug ")
Error registering authentication agent: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.106" (uid=0 pid=103429 comm="/usr/bin/pkttyagent --notify-fd 5 --fallback ") interface="org.freedesktop.PolicyKit1.Authority" member="RegisterAuthenticationAgentWithOptions" error name="(unset)" requested_reply="0" destination=":1.2" (uid=999 pid=6336 comm="/usr/lib/polkit-1/polkitd --no-debug ") (g-dbus-error-quark, 9)
/var/log/messages 报错
Apr 15 11:34:36 wuxin-123 dbus[6339]: [system] Rejected send message, 1 matched rules; type="method_call", sender=":1.109" (uid=0 pid=103805 comm="/usr/bin/pkttyagent --notify-fd 5 --fallback ") interface="org.freedesktop.PolicyKit1.Authority" member="RegisterAuthenticationAgentWithOptions" error name="(unset)" requested_reply="0" destination=":1.2" (uid=999 pid=6336 comm="/usr/lib/polkit-1/polkitd --no-debug ")
解决 发现切换用户会卡主 重启服务报错
可能与系统用户登录服务有关重启后 解决。
[root@oldboy-123 ~]# systemctl restart systemd-logind.service
[root@oldboy-123 ~]#su - oldboy
Last login: Mon Apr 15 09:27:22 CST 2019 on pts/1
[oldboy@oldboy-123 ~]$ logout
[root@oldboy-123 ~]#
[root@oldboy-123 ~]# systemctl restart firewalld
配置完成epel源之后完整 常用的软件包
yum install -y tree vim nc nmap lrzsz wget bash-completion* cowsay sl htop iotop iftop