rhcsa笔记
图形化界面安装:
yum install -y glx* xorg* gnome*
Systemctl set-default graphical.target
主机名更改命令:
hostnamectl set-hostname server10.example.com
配置IP 网关 dns等:
- nmcli connection show
nmcli nonnection modify “eth0” ipv4.addresses “172.25.0.11/24 172.25.254.254” ipv4.dns 172.25.254.254 ipv4.method manual connection.autoconnect yes
nmcli con up eth0
- nm-connection-editor
逻辑卷缩小/扩容:
lvresize -r -L
访问控制列表:
setfacl -m u:natasha:rw /var/fstab
setfacl -m other::--- /var/fstab
自动挂载:
yum install -y autofs
vim /etc/auto.master
/home/guests /etc/auto.ldap
vim /etc/auto.ldap
* -fstype=nfs,rw,sync classroom:/home/guests/&
Systemctl restart autofs
Systemctl enable autofs
安装yum源:
yum-config-manager --add-repo=” http://content.example.com/rhel7.0/x86_64/dvd ”
Yum repolist all
升级内核:
yum update -y kernel
检查:uname -a
Cat /proc/version
安装ntp服务:
yum install -y chrony
vim /etc/chrony.conf
Server classroom.example.com iburst
Systemctl restart chronyd
Systemctl enable chronyd
制作交换分区
创建扩展分区
更改分区ID号: 82
mkswap /dev/sdb5
Swapon /dev/sdb5
echo “/dev/sdb5 swap defaults 0 0”>>/etc/fstab
Swapon -a/swapon -s
扩展文件系统
Ext3/ext4 resize2fs /dev/vg1/lvm1
Xfs xfs_growfs /dev/vg1/lvm1
Ldap服务
yum install -y openldap openldap-clients sssd authconfig-gtk
Selinux状态查看
Sestatus
归档解压:
tar -zcvf japan.tar.gz japan 打包压缩
tar -zxvf japan.tar.gz japan 解压缩
tar -jcvf
tar -jxvf
完整写法:
归档: tar -cjvf /root/backup.tar.bz2 /etc
解压: tar -xjvf /root/backup.tar.bz2 -C