RHCSA模拟题
- 格式:pdf
- 大小:144.39 KB
- 文档页数:6
Mkdir –p /home/adminsChown admin /home/adminsChmod 770 /home/adminsChmod g+s /home/adminsLd –ld /home/admins在home下创建一个目录admins,加入组admin组的用户可以读和写,其他用户不允许进入。
在这个目录下的任何文件所属组都自动继承为adminMkdir /home/adminsLs –ld /home/admimsChgrp –R admin /home/adminsChmod 760 /home/adminsChmodg+s /home/adminsLs –ld /home/adminsLd 查看文件夹的本身Ls 查看文件夹里面的东西Groupadd –g 610 admin添加一个组GID 为610groupadd -g610 adminFdisk /dev/vdaNP1+420MT8eWPartprobe /dev/vdaCat /proc/partitionsPvcreate /dev/vda1 格式化vda1Vgcreate –s 8M vg1 /dev/vda1 –s指定pe大小默认4MLvcreate –l 50 –n lv1 vg1 -n表示卷名–L表示指定lv大小-s支持快照Mkfs.ext4 /dev/vg1/lv1Mkdir –p /mnt/dataVim /etc/fstab/dev/vg1/lv1 /mnt/data etx4 defaults 0 0Mount -adf -ThPvcreate /dev/sda1 (sd1要分的比400M大一些)Vgcreatevgtest /dev/sda1 –s 8Mlvcreate–l 50 –n lvtestvgtestMkfs.ext4 /dev/vgtest/lvtestVim /etc/fstab/dev/vgtest/lvtest /mnt/data ext4 default 0 0Mount -adf -ThCat /etc/grub.confRpm –ivh kernel-2.6.36.7.1.rpmVim /etc/grob.confDefault=0rebootcat /etc/grub.confUname–rUname–r > rhcsa.txtrpm–ivh kernel-2.6.36.7.1.rpmvim /etc/grub.confdefault=0rebootgrub是以hd来识别磁盘的,第一磁盘为hd0,第二个磁盘为hd1...,而hd0,0表示第一个磁盘的第一个分区,hd0,1表示第一个磁盘的第二个分区...,并且grub是直接读分区来找到对应的文件;而我的系统上只有一块硬盘,并且/boot是一个单独的分区,并且为系统的第一个分区,grub等文件在这个分区上。
1、root密码破解选第一个内核,通过e进入内核编辑。
在linux16这行的最后增加rd.break 然后按ctrl+x重启,进入急救命令行模式。
操作如下:mount -o remount,rw /sysroot 重新挂载/sysroot目录chroot /sysroot ,切换根到该目录passwd,修改root密码,也可以通过echo xxxx(密码)| passwd --stdin root的方式touch /.autorelabel ,更新该文件,注意文件名exit然后reboot即可注意:有些考官会直接告诉你root密码需要重置,根据网页给出的密码重置即可,建议写纸上方便后续登录。
图形化是有的,login后startx就可以登录。
2、确认selinux的模式描述:Linux 必须运行在Enforcing 模式selinux的配置文件是:/etc/selinux/config,查看里面的模式,改成enforcing,注意还要getenforce确认当前是否开启,通过setenfoce 1和0 来开启和关闭selinux有3种模式:enforcing,SELinux security policy is enforced.主动模式,任何违规行为都会被立即停止permissvie,SELinux prints warnings instead of enforcing.被动模式,违规行为被记录但是不停止disabled,No SELinux policy is loaded. 关闭模式,未开启selinux,不会处理违规行为注意:我考试的时候模式是passive,需要vim /etc/selinux/config文件然后设置setenfore 1 ,从passive到enfocing可以不用重启,但是从disabled 到enforcing是要重启的。
3、配置yum源描述:YUM 的软件库源为/rhel. 将此配置为您的系统的默认软件仓库。
RHCSA试题密码破解在linux16最后加入rd.break进入交换模式以后输入下列指令:mount -o remount,rw /sysrootchroot /sysrootpasswd roottouch /.autorelabel //更新SE上下文exitreboot虚拟机环境yum 源地址IP地址分配desktopX 地址172.25.X.10/24 GW172.25.X.254 DNS 172.25.254.254serverX 地址172.25.X.11/24 GW172.25.X.254 DNS 172.25.254.254密码修完完成,注意此处是修改的你考试用的虚拟机密码,而不是物理机密码。
IP 地址的设置,和主机名信息。
hostnamectl set-hostname #设置主机名nmcli connection modify eht0 ipv4.method manual #nmcli connection modify eth0 ipv4.addresses '172.25.X.10/24 172.25.X.254'nmcli connection modify eth0 ipv4.dns '172.24.254.254'nmcli connection up eth0nmcli con show eth0 | grep ipv4host route -n 路由IP 地址也可以使用nm-connection-editor 图形化界面进行修改。
RHCSA 部分全部上DESKTOPX 上完成即可。
1.配置SELINUX 使其工作在enforcing 模式下解法:getenforce //查看模式setenforce 1 //设置为enforcing 模式getenforce //查看vim /etc/selinux/config //永久修改selinux=enforcing:wq重启然后使用sestatus 命令查看SE状态2.为您的系统配置一个默认的软件仓库一个YUM 源已经提供了在http://classroom.ex /content解法:添加实例yum-config-manager --add-repo=rhel7vim/etc/yum.reopos/base.repo[rhel7-base]name=basebaseurl= /contentgpgcheck=0enabled=1保持退出yum repolist 进行验证3.调整逻辑卷的大小调整逻辑卷vo 的大小,它的文件系统大小应该为290M.确保这个文件系统的内容完整。
rhcsa认证题库RHCSA(Red Hat Certified System Administrator)认证是由红帽公司提供的一项基于Linux操作系统的认证,旨在评估个人在使用和管理Red Hat Enterprise Linux系统方面的技能。
本文将为大家提供一份RHCSA认证题库,帮助考生更好地复习和准备考试。
第一题:在Linux中,如何查看当前系统的IP地址和网关?解析:可以使用ifconfig命令来查看当前系统的IP地址,使用route 命令来查看网关。
第二题:如何在Red Hat Enterprise Linux 7中创建一个新的用户?解析:可以使用useradd命令来创建新用户,如:useradd username。
第三题:如何查看当前系统的CPU信息?解析:可以使用cat /proc/cpuinfo命令来查看当前系统的CPU信息。
第四题:如何在Linux中安装新的软件包?解析:可以使用yum命令来安装新的软件包,如:yum install package。
第五题:如何查看当前系统的内存使用情况?解析:可以使用free命令来查看当前系统的内存使用情况。
第六题:如何在Linux中设置防火墙规则?解析:可以使用iptables命令来设置防火墙规则,如:iptables -A INPUT -p tcp --dport 22 -j ACCEPT。
第七题:如何在Linux中查找一个文件?解析:可以使用find命令来查找一个文件,如:find / -name filename。
第八题:如何在Linux中压缩和解压文件?解析:可以使用tar命令来压缩和解压文件,如:tar -czvf archive.tar.gz file1 file2。
第九题:如何查看当前系统的磁盘使用情况?解析:可以使用df命令来查看当前系统的磁盘使用情况。
第十题:如何修改Linux系统的主机名?解析:可以使用hostname命令来修改Linux系统的主机名,如:hostname newhostname。
Mkdir –p /home/adminsChown admin /home/adminsChmod 770 /home/adminsChmod g+s /home/adminsLd –ld /home/admins在home下创建一个目录admins,加入组admin组的用户可以读和写,其他用户不允许进入。
在这个目录下的任何文件所属组都自动继承为adminMkdir /home/adminsLs –ld /home/admimsChgrp –R admin /home/adminsChmod 760 /home/adminsChmodg+s /home/adminsLs –ld /home/adminsLd 查看文件夹的本身Ls 查看文件夹里面的东西Groupadd –g 610 admin添加一个组GID 为610groupadd -g610 adminFdisk /dev/vdaNP1+420MT8eWPartprobe /dev/vdaCat /proc/partitionsPvcreate /dev/vda1 格式化vda1Vgcreate –s 8M vg1 /dev/vda1 –s指定pe大小默认4MLvcreate –l 50 –n lv1 vg1 -n表示卷名–L表示指定lv大小-s支持快照Mkfs.ext4 /dev/vg1/lv1Mkdir –p /mnt/dataVim /etc/fstab/dev/vg1/lv1 /mnt/data etx4 defaults 0 0Mount -adf -ThPvcreate /dev/sda1 (sd1要分的比400M大一些)Vgcreatevgtest /dev/sda1 –s 8Mlvcreate–l 50 –n lvtestvgtestMkfs.ext4 /dev/vgtest/lvtestVim /etc/fstab/dev/vgtest/lvtest /mnt/data ext4 default 0 0Mount -adf -ThCat /etc/grub.confRpm –ivh kernel-2.6.36.7.1.rpmVim /etc/grob.confDefault=0rebootcat /etc/grub.confUname–rUname–r > rhcsa.txtrpm–ivh kernel-2.6.36.7.1.rpmvim /etc/grub.confdefault=0rebootgrub是以hd来识别磁盘的,第一磁盘为hd0,第二个磁盘为hd1...,而hd0,0表示第一个磁盘的第一个分区,hd0,1表示第一个磁盘的第二个分区...,并且grub是直接读分区来找到对应的文件;而我的系统上只有一块硬盘,并且/boot是一个单独的分区,并且为系统的第一个分区,grub等文件在这个分区上。
RHEL6 .0-RHCSA考试题库RHCSA 2.5小时总分300分,210分pass考试环境熟悉点:1.首先注册好信息,选择简体中文。
会包括姓名,邮箱,地址;然后同意签署保密协议;最后选择考试科目。
生成一个user和密码,使用此用户密码登陆真实机器2..考试为上机考试,在一台真实机器的linux系统中,已经安装好了RHEL的KVM虚拟机要求所有的考试题必须在虚拟机中完成3.考试所用虚拟机在考试机器的桌面上有图标,可以控制虚拟机的启动,关闭,重启等4.考试题目为简体中文,考试虚拟机系统为英文。
5.考试题库的题目考试机器的桌面上也有图标,上面有考试的考试信息说明和考试题目:考试前的说明信息一定要抽出时间看好看清看全考试说明里面注意要设置的root密码ip addreass:172.24.X0.25/24(此处X0,若你的机器号为1,则X0为10)光盘中的软件包路径://server1.domainx0.考试前必须操作的:点击kvm虚拟机图标---选择菜单倒第二项(console view)---选择菜单第一项(start up EXAM)---选择虚拟机右下角的圆形按钮重启按e键终止倒计时---在默认的系统启动条目上按e键进入编辑模式---用上下键选择包含了内核的行(即包含vmlinuz的行)---按e键进入编辑---在行尾增加空格1---按回车键---按b键启动---进入单用户模式getenforce 查看当前selinux状态,默认应该是强制模式setenforce 0passwd root(考试说明里面给出你要设置的root密码)---reboot重启2.KVM虚拟机的网络环境配置hostname,ip adress,gateway,DNS等信息选择Applications---System Tools---Terminal ---考试环境,右键没有在终端中显示,需要在这个路径打开终端首先关闭防火墙:[root@server ~]# iptables –F[root@server ~]# chkconfig iptables off接下来关闭SELINUX[root@server ~]# vim/etc/sysconfig/network 修改主机名exit 退出终端,重新登录/etc/hosts 文件不用修改图形化界面设置ip选择System---Preferences---Network Connections修改完成之后重启网卡以及验证hostname 查看下主机名,网络配置若影响主机名hostname更改过来验证:ifconfig cat /etc/sysconfig/network-scripts/ifcfg-eth0nslookup station.domain30.example DNS解析-----------------------------------------------------------------------------------------[base]name=baseenable=1gpgcheck=0------------------------------------------------------------------------------------------验证:yum clean allyum list 如果看到关于base的软件包出现,则表示配置成功如果在后面做题过程中yum出现问题,进入/etc/yum.repos.d/目录里面,保留自己配置的base.repo,剩余文件全部删除。
rhcsa考试题Title: RHCSA Certification Exam QuestionsIntroduction:RHCSA (Red Hat Certified System Administrator) is a widely recognized certification for Linux system administration. This article aims to provide a set of RHCSA exam questions, covering various topics that may be encountered in the exam. The questions are designed to test your knowledge and practical skills in Linux administration. Please note that this article does not provide direct answers to the questions, as the purpose is to challenge and evaluate your understanding of RHCSA concepts.Exam Question 1: System Initialization and Services1. Briefly explain the booting process of a Linux system.2. How can you determine the current runlevel of a system?3. What is systemctl? Provide an example of how to enable and start a service using systemctl.Exam Question 2: Filesystem Management1. Describe the purpose and usage of the following filesystem-related commands: df, du, mount, and umount.2. How can you create a new ext4 filesystem on a partition?3. Explain the purpose and configuration of the /etc/fstab file.Exam Question 3: User and Group Administration1. How can you create a new user account in Linux?2. How do you assign a user to a specific group?3. Explain the purpose and usage of the following commands: passwd, chage, and usermod.Exam Question 4: Network Configuration1. Describe the purpose and configuration of the /etc/resolv.conf file.2. How can you assign a static IP address to a network interface in CentOS?3. Explain the usage of the following commands: ifconfig, ip, and ping.Exam Question 5: System Security1. How can you set a strong password policy for user accounts?2. Explain the purpose and configuration of the /etc/sudoers file.3. What is SELinux, and how can you temporarily disable its enforcement?Exam Question 6: Process Monitoring and Management1. How can you view the currently running processes and their resource utilization?2. Describe the usage of the following commands: ps, top, and kill.3. How do you schedule a background process to run at a specific time using cron?Exam Question 7: Package Management1. Explain the purpose and usage of the following package management commands: yum and rpm.2. How can you list all the installed packages on a CentOS system?3. Describe the process of installing a package from a local RPM file.Exam Question 8: Troubleshooting and System Maintenance1. How can you check the system logs for any error messages or warnings?2. Explain the usage of the following commands: dmesg, journalctl, and tail.3. What steps would you take to investigate and resolve a network connectivity issue?Conclusion:This article presented a sample set of questions based on various topics that may appear in the RHCSA certification exam. It is important to thoroughly study the relevant concepts, commands, and configurations to effectively prepare for the exam. Remember, practical hands-on experience in Linux administration is equally essential. The RHCSA certification validates your skills and knowledge in Linux system administration and can greatly enhance your career prospects in the IT industry. Good luck with your exam preparation!。
红帽试题rhcsa+rhceRHCSA1.新建一个512M分区,格式化成ext4,并挂载至/data目录要求每次开机生效答:# fdisk /dev/xvda 然后建立一个512M分区,如/dev/xvda5# partprobe /dev/xvda或者reboot机器# mkfs –t ext4 /dev/xvda5# mkdir –p /data# vim /etc/fstab添加/dev/xvda5 /data ext4 defaults 0 0# mount -a2.将/home分区在线拉升至512M,在490M-510M之间是允许的答:# df –h /home 确定其lv,比如是/dev/vol0/home# lvresize –L 508M /dev/vol0/home# resize2fs /dev/vol0/home3.将/home减小至320M,在290M至310M之间是允许的,不要损坏该系统中数据答:# df –h /home 确定其lv,比如是/dev/vol0/home# umount /home# e2fsck –f /dev/vol0/home# resize2fs /dev/vol0/home 300M# lvresize –L 308M /dev/vol0/home# mount /home4.新建个卷组, 每个PE大小为8M,在该卷组中创建LV,lv名为lvshare,大小为50PE,格式化为ext4,开机挂载至/mnt/data目录,要求每次开机均生效,在380M-400M之间是允许的答:# fdisk去新分区大小为1G即可,并标记成8e格式,如/dev/xvda6# partprobe或reboot# pvcreate /dev/xvda6# vgcreate –s 8M vg1 /dev/xvda6# lvcreate –n lvshare –l 50 vg1# mkfs.ext4 /dev/vg1/lvshare# mkdir –p /mnt/data# vim /etc/fstab添加/dev/vg1/lvshare /mnt/data ext4 defaults 0 0# mount –a ; df -h5.将ftp://192.168.0.254/pub/boot.iso 下载至/root,并将其挂载至/media/cdrom,要求每次开机生效答:# cd /root; wget ftp://192.168.0.254/pub/boot.iso# mkdir –p /media/cdrom# vim /etc/fstab添加/root/boot.iso /media/cdrom iso9660 defaults,loop 0 0# mount -a6.增加一个SWAP250M,不影响原有的SWAP,要求每次开机生效答:# fdisk 新建一个分区250M,如/dev/xvda7,并标记成82格式# mkswap /dev/xvda7# vim /etc/fstab添加/dev/xvda7 swap swap defaults 0 0# swapon –a; swapon -s二.用户与权限1.新建admin组指定gid=600答:# groupadd –g 600 admin2.新建user1用户,指定uid=601,该用户密码为redhat,该用户不允许交互式登录答:# useradd –u 601 –s /sbin/nologin user1# echo redhat |passwd -–stdin user13.新建user2,user3用户,将这两个用户加入admin组中,作为附加组,用户密码为redhat答:# useradd –G admin user2# useradd –G admin user3# echo redhat | passwd --stdin user2# echo redhat | passwd –-stdin user34.在/home目录创建admin目录,要求该目录的拥有组为admin,要求该组中成员成该目录有读写权限,组中成员在该目录中创建文件也属于admin组答:# mkdir –p /home/admin# chgrp admin /home/admin# chmod g=srwx /home/admin5.将/etc/fstab复制到/var/tmp中,设置文件的拥有组为admin,要求user1对该文件有完整的权限,user2对该文件无任何权限答:查看命令为:getfacl /var/tmp/fstab# cp /etc/fstab /var/tmp/# chgrp admin /var/tmp/fstab# vim /etc/fstab在包括var文件系统的行的第四段增加acl选项,如defaults,acl# mount –o remount –a# setfacl –m u:user1:rwx /var/tmp/fstab# setfacl –m u:user2:--- /var/tmp/fstab6.创建计划任务,要求在每月1.3.5日14:30分执行/bin/echo hello 仅允许root 和user2用户能创建计划任务答:# 如果是系统级别的计划任务在编辑/etc/crontab文件,添加30 14 * * 1,3,5 /bin/echo hello如果是root的计划任务则# crontab –e –u root30 14 * * 1,3,5 /bin/echo hello# vim /etc/cron.allowrootuser2三.内核1.将内核升级到2.6.32-71.7.1,确认新内核作为默认启动项,新内核在http://192.168.0.254/pub/rhel6/errata/rhel-x86-64-server-6 答:需要fireware和内核包# 用firefox或者wget去上述地址下载合适版本的kernel文件# yum localinstall –y --nogpgcheck kernel-file-path# vim /boot/grub/grub.conf确认默认启动kernel2.修改root用户密码为redhat123答:# echo redhat123 | passwd –-stdin root3.开启ip转发,并在每次启动均生效答:# vim /etc/sysctl.confnet.ipv4.ip_forward = 1# sysctl -ph4.开启kmcrl的值为5,并在/proc/cmdline中可以进行验证答:# vim /boot/grub/grub.conf在默认启动kernel的包含vmlinuz的行尾添加kmcrl=55.设置时间使用NTP,选择合适的时区, NTP server /doc/735209153.html, 答:运行system-config-date即可6.查找/home目录下文件拥有人是user2,但拥有组不是user2的文件复制到/root/backup文件夹中答:# mkdir /root/backup# find /home –user user2 ! –group user2 –exec cp {} /root/backup \;7.下载http://192.168.0.254/pub/vsftpd.conf文中至/root目录,将该文中包含yes/YES的行过滤(但不包含空行和以“#”开始的行)导出至/root/findfs.txt文中,不要改变文中内容输出顺序答:# wget http://192.168.0.254/pub/vsftpd.conf -O /root/vsftpd.conf# grep –v ‘yes’ /root/vsftpd.conf | grep –v ‘YES’>/root/findfs.txt四.网络1.设置静态网络信息ip:192.168.0.x 子网掩码:255.255.255.0 网关:192.168.0.254DNS:192.168.0.254 第二网关:192.168.0.1.254 要求网卡开机均自动激活答:# system-config-network五.脚本1.写一个脚本/root/myscnpts.sh,当用户输入/root/myscnpts.sh all显示none /root/myscnpts.sh none 显示all,当用户执行/root/myscnpts.sh 或非all 或none时,将“error:plase usage /root/myscnpts.sh none/all" 使用标准错误输出答:# vim /root/myscnpts.shif [ $1 = all ] ; thenecho noneelif [ $1 = none ] ; thenecho allelseecho “error: please usage /root/myscnpts.sh none|all”fi六.FTP1.新建FTP服务,允许匿名用户上传和下载文件答:# yum install –y vsftpd# vim /etc/vsftpd/vsftpd.conf修改anon_upload_enable=YESanonymous_enable=YES# mkdir –p /var/ftp/incoming; chmod 777 /var/ftp/incoming # chcon -t public_content_rw_t /var/ftp/incoming# setsebool -P allow_ftpd_anon_write=1# service vsftpd start; chkconfig vsftpd on2.允许192.168.0.0/24访问该FTP,拒绝192.168.1.0/24答:# vim /etc/hosts.denyvsftpd: 192.168.1.0/255.255.255.0# vim /etc/hosts.allowvsftpd: 192.168.0.0/255.255.255.0七. LDAP1.配置你的主机使用LDAP认证,并使用TLS认证,证书在http://192.168.0.254/pub/EXAMPLE-CA-CERT,LDAP信息如下,LDAPserver:/doc/735209153.html, base DN:dc=example,dc=com你将可以使用ldapuserx登录,密码为password答:以ldapuser5用户举例# system-config-authentication#chkconfig sssd on# getent passwd ldapuser5# 使用用户ldapuser5密码password登录系统2.当使用ldapuserx用户登录时用户需要家目录,家目录已通过NFS共享,NFS:192.168.0.254:/home/guests使用autofs自动将用户家目录挂载答:以ldapuser5用户举例# 首先用getent passwd ldapuser5查看ldapuser5的家目录# showmount –e 192.168.0.254查看nfs输出# vim /etc/auto.master/home/guests(本地目录) /etc/auto.nis# vim /etc/auto.nisldapuser5(本地显示名称) -rw 192.168.0.254:/home/guests/ldapuser5(服务端的共享目录名称) 注意:本地的ldapuser5目录,不要手动建立,挂载时会自动建立任意匹配:* -ro 192.168.0.254:/home/guests/&# service autofs restart; chkconfig autofs on# 测试:用ldapuser5用户登录,pwd查看是否在家目录下,mount查看是否mount 成功。
第一部分RHCSA模拟11.1破解system1的root口令1破解密码确保计算机正常登陆。
1.2配置主机名,ip地址,网关,DNS,保证system1和system2是用静态IPv4配置2按照给出的信息进行配置IP参数。
1.3配置SElinux(课程3)2配置system1的SElinux 为enforcing(永久生效)1.4配置yum(课程3)3为您的系统配置一个默认的软件仓库一个YUM源已经提供在:http:///rhel7/dvd配置你的系统,并且yum能正常使用。
1.5调整逻辑卷大小(LVM)(课程4)3系统中的home已经被挂载将此分区调整为300M不能破坏原有的数据1.6创建用户账号(课程4)4创建下列的用户、组和组成员关系:创建名字为adminuser的组用户natasha,使用adminuser作为附属组用户harry,也使用adminuser作为附属组用户sarah,在系统中不能访问可交互的SHELL,且不是adminuser的成员,natasha,harry,sarah密码都是redhat1.7配置文件权限(FACL)(课程5)4复制文件/etc/fstab到/tmp/fstab,配置/temp/fstab的权限如下:文件/tmp/fstab所有者是root文件/tmp/fstab属于root组文件/tmp/fstab不能被任何用户执行用户natasha可读/tmp/fstab用户harry可读写/tmp/fstab所有其他用户对用户对/tmp/fstab 没有任何权限1.8配置一个cron计划任务(课程5)5用户harry配置一个cron job,当地时间每天14:23运行,执行/bin/echo hello1.9管理目录权限(课程5)5创建一个目录/home/admins, 使之具有下面的特性目录/home/admins所属组为adminuser这个目录对组adminuser的成员有可读、写和执行权限在/home/admins创建的任何文件所属组自动设置为adminuser1.10绑定到外部验证服务器(课程6)5配置系统使用ldap认证,口令使用LADP服务器的认证口令Ldap域名:dc=example,dc=comLdap服务器:Ldap证书:http:///pub/example-ca.crt用户ldapuserX登录后,没有home目录信息,除非配置了后续的autofs 1.11配置NTP(课程6)6配置主机和进行时钟同步1.12配置autofs(课程7)61.13添加一个swap分区(课程7)71.14查找文件内容(课程8)81.15管理逻辑卷(LVM)(课程8)8第二部分RHCE 模拟2.1配置链路聚合(课程9)102.2 IPv6(课程10)112.3防火墙端口转发(课程10)112.4自定义用户环境(课程10)112.5配置对SSH的限制(课程12)112.6配置本地邮件服务(postfix)(课程11)122.7配置Samba服务器(课程12)122.8 system2配置为Samba客户端132.9配置基本的NFS的共享(课程13)152.10 在system1上,配置Kerberos(课程13)162.11配置HTTP虚拟主机(课程14)182.12配置HTTPS虚拟主机站点(课程14)192.13配置Http虚拟主机(课程15)212.14 HTTP虚拟目录及限制访问(课程15)212.15配置基于非常规端口的wsgi站点(课程15)222.16 ISCSI Target(课程16)232.17 iSCSI Initiator(课程16)252.18基本脚本(课程17)262.19 创建添加用户脚本(课程17)262.20 MariaDB-1(课程17)272.21 MariaDB-2(课程17)29。
RHCE测试练习题RHCSA:一破解密码,要求root用户登录密码为redhat在grub下进入命令模式,在内核参数后加上参数1,进入单用户模式启动启动后先使用setenforce 0关闭selinux,然后使用passwd修改root密码。
二设置网络IP 192.168.0.X网关为192.168.0.254dns:192.168.0.254system-config-network用图形化方式来修改网络配置service network restart三把/home的分区大小改为100M(大小可容许有一定误差),不能损坏原有数据df -THumount /home/e2fsch -f /dev/mapper/vgsrv-homeresize2fs /dev/mapper/vgsrv-home 100Mlvreduce -L 100M /dev/mapper/vgsrv-homemount -adf -TH四新建一个manager组,新建三个账号:harry,natasha,sarah,要求:1.harry和natasha的第二属组为manager;2.sarah指定使用的shell为/sbin/nologin;3.密码设置成password;groupadd manageruseradd -G manager harryuseradd -G manager natashauseradd -s /sbin/nologin sarahpasswd harrypasswd natashapasswd sarah五创建/command目录,属于manager,同组拥有相同读写权限,其他人没有任何权限,在该组下创建的文件都隶属于该组,且其他人不可删除mkdir /commandll -d /commandchgrp manager /commandchmod g+w /commandchmod o-rx /commandchmod o+t /commandchmod g+s /commandll -d /command六开启系统内核转发包功能vim /etc/sysctl.confnet.ipv4.ip_forward = 1sysctl -p七在ftp://192.168.0.254/pub/rhcsa/有新内核kernel-2.6.32-71.7.1.el6.x86_64和内核放火墙kernel-firmware-2.6.32-71.7.1,下载并安装,系统启动以旧内核启动lftp 192.168.0.254cd pubcd rhcsamget kernel-2.6.32-71.7.1.el6.x86_64.rpm kernel-firmware-2.6.32-71.7.1.el6.noarch.rpmbyerpm -ivh kernel-*.rpmvim /boot/grub/grub.confdefault=0改为default=1八配置yum源,软件源位于ftp://192.168.0.254/pub/rhel6/dvdvim /etc/yum.repos.d/server.repo[server]name=this is test serverurl=ftp://192.168.0.254/pub/rhel6/dvdenabled=1gpgcheck = 0九natasha用户设置一个计划任务每天晚上8点45分,执行/bin/echo howdycrontab -e -u natasha45 20 * * * /bin/echo howdy:wqcrontab -u satasha -l十192.168.0.254这个服务器上有用户ldapuser1,LDAP的DN: dc=example,dc=com,证书在:http://192.168.0.254/pub/EXAMPLE-CA-CERT,启动TLS加密,LDAP认证方式为:LDAP passwordsystem-config-authenticationUser Account Database -->LDAPLDAP Search Base DN: dc=example,dc=comLDAP Server: ldap ://192.168.0.254/Use TLS to encrypt connections启动加密下载证书Certificate URL: http://192.168.0.254/pub/EXAMPLE-CA-CERTAuthentication Method: LDAP passwordgetent passwd ldapuserXid ldapusersu – ldapuserX十一允许用户ldapuser1登录后能自动进入其自己的家目录,使用autofsvim /etc/auto.master/home/guests auto.ldap:wqcp /etc/auto.misc /etc/auto.ldapvim /etc/auto.ldapldapuserX -fstype=nfs,rw 192.168.0.254:/home/guests/ldapuserX:wqservice autofs stop 注:不能用restartservice autofs startsu – ldapuserX十二拷贝/etc/fstab到/var/tmp/下,natasha可读写rw,harry没有任何权限cp /etc/fstab /var/tmp/ll /var/tmp/fstabchgrp manager /var/tmp/fstabsetfacl -m u:natasha:rw /var/tmp/fstabsetfacl -m u:harry:-- /var/tmp/fstabgetfacl /var/tmp/fstab十三在整个文件系统中查找属主为natasha的所有文件,并拷贝到/root/found/下mkdir /root/found/find / -user natasha -exec cp -rf {} /root/found/ \;十四创建一个账号jean,指定uid为4332useradd -u 4332 jeanid jean十五把系统的swap大小增大512Mswapon -sfdisk -cu /dev/vda创建扩展分区创建逻辑分区512M/dev/vda5t5l82wpartx -a /dev/vdamkswap /dev/vda5swapon /dev/vda5swapon /dev/vda5 -svim /etc/fstab/dev/vda5 swap swap defaults 0 0 :wqmount -a十六搭建FTP服务,要求:能够匿名下载,开机启动yum install vsftpd*service vsftpd restartchkconfig vsftpd oncp /etc/fstab /var/ftp/publftp localhostcd pubget fstabbye十七搭建web,开机启动,从ftp上下载station.html,保证能默认访问到此网页yum install httpd -ylftp 192.168.0.254cd pubget station.htmlcp station.html /var/www/html/index.htmlservice httpd restartchkconifg httpd restartlinks http://127.0.0.1十八在/usr/share/dict/words找出所有包含strato的行放到到/root/lines.txt中cd /usr/share/dictcat words | grep strato > /root/lines.txt十九新建一个LVM,自动挂载到/mnt/wshare下,LVM的要求如下:逻辑卷组wgroup大小100,以PE大小为8M创建一个80M的逻辑分区wsharefdisk -cu /dev/vda新创建100M的分区/dev/vda6t68ewpartx -a /dev/vdapvcreate /dev/vda6vgcreate wgroup -s 8M /dev/vda6vgdisplaylvcreate -l 10 -n wshare wgroupmkfs.ext4 /dev/wgroup/wsharemkdir /mnt/wsharevim /etc/fstab/dev/wgroup/wshare /mnt/wshare ext4 default 0 0mount -aRHCE:一保证SElinux在开机后开启vim /etc/sysconfig/selinuxselinux = enforcingsetenforce 1getenforce二开启系统内核转发包功能vim /etc/sysctl.confnet.ipv4.ip_forward=1三现有两个网段,为172.16.0.0/16,为172.25.0.0/16,现要求网段能访问本机,网段不能访问iptables -Fiptables -A INPUT -s 172.25.0.0/16 -j REJECTservice iptables saveservice iptables restart四搭建ftp服务器,匿名用户可以上传下载,拒绝172.25.0.0/26网段yum install vsftpd -yservice vsftpd restartchkconfig vsftpd onvim /etc/vsftpd/vsftpd.confanon_upload_enabled = yesanon_mkdir_write_enabled = yesservice vsftpd restartchmod o+w /var/ftp/pubgetsebool -a | grep ftpsetsebool -P allow_ftpd_full_access on五搭建SMTP邮件服务器,能够正常接发邮件,域名为,主机为本机名,支持邮件别名功能,即发给admin的邮件发给natashayum install postfixvim /etc/postfix/mian.cfmyhostname = server mydomain = myorigin = $mydomain#inet_interface = localhostinet_interface = allchkconfig postfix onvim /etc/aliasesadmin: natashanewaliasessetvice postfix restart六搭建samba服务器,共享出共享出/client目录,用户natasha能够访问yum install samba* -ychkconifg smb onvim /etc/samba/smb.conf[client]path = /clientwritable = yesservice smb restartsmbpasswd -a natashachcon -t samba_share_t /client七把/client提供给172.16.0.0/24网段的用户NFS共享vim /etc/exports/client 172.16.0.0/255.255.255.0 (ro,sync)service nfs restartchkconifg nfs on八拒绝网段的用户使用ssh访问到本机ipta bles -A INPUT -s 172.25.0.0/16 -p tcp --dport 22 -j REJECT九搭建WEB服务器,启用虚拟主机且wwwX的页面只能是tom用户才能访问yum install httpdvim /etc/httpd/conf/httpd.conf<virtualhost *:80>...<directory /var/www/html/www13>authname server-13-passwordauthtype basicauthuserfile /etc/httpd/conf/.htpasswdrequire valid-user</directory></virtualhost>htpasswd -mc /etc/httpd/conf/.htpasswd tomcut -d: -f1-2 /etc/shadow > /etc/httpd/conf/.htpasswdelinks 十开机自动挂载boot下的iso文件到/mnt/cdrom下mkdir /mnt/cdromvim /etc/fstab/root/cdrom.iso /mnt/cdrom iso9660 default,loop 0 0十一内核参数/proc/cmdline参数有sysctl = 1,启动可以看到vim /boot/grub/grub.conf内核之后加上sysctl = 1cat /proc/cmdline十二编写shell脚本,要求:shell脚本运行命令后接参数a或b,输出相反的值。
rhcsa认证题库(中英文版)Title: rhcsa认证题库To pass the Red Hat Certified System Administrator (RHCSA) exam, it is essential to have a solid understanding of the Red Hat Linux operating system.The RHCSA certification is the first step in the Red Hat Certified Professional (RHCE) path and validates your skills in performing basic system administration tasks.要通过红帽认证系统管理员(RHCSA)考试,重要的是要充分理解红帽Linux 操作系统。
RHCSA认证是红帽认证专业(RHCE)路径的第一步,它验证您在执行基本系统管理任务方面的技能。
The RHCSA exam is a performance-based test, which means you will be evaluated on your ability to perform specific tasks on a live system.To prepare for the exam, it is recommended to use a practice environment where you can experiment with different commands, configuration files, and system settings.RHCSA考试是基于性能的测试,这意味着您将根据您在实时系统上执行特定任务的能力进行评估。
为了准备考试,建议使用一个练习环境,您可以在其中尝试不同的命令、配置文件和系统设置。
红帽初级认证考试指导练习题一、考试准备——考试练习环境安装与搭建环境配置随着练习系统的不同而不同1、首先安装虚拟机2、登录虚拟系统○1打开虚拟机classroom,账号:root,密码:Asimov,开启classroom,将rhcsaexam.tar压缩文件复制到classroom的桌面。
此机为考试服务器○2在classroom桌面右键打开终端,接着解压:# tar –xvf rhcsaexam.tar –C /(大写C)○3打开虚拟机server,账号:root,密码:redhat(如无法进入将server快照至初始状态)3、在server中安装考试题库# lab examrhcsa setup (安装)# lab examrhcsa grade (查看成绩)破解root密码,进入纯字符命令行模式,输入root及要求破解的密码,出现#后输入:# init 5进入图形界面(ping 172.25.0.254)2、配置IP在右侧的声音图标旁的两个小电脑上点右键——Network settings——Addprofile(如果已有,则点击小齿轮进行设置即可)——ipv4设置Address选择Manual将考试要求的配置信息填入对应的地址栏。
例如:ip:172.25.0.11 子网:255.255.255.0 网关:172.25.0.254 DNS服务器: 172.25.0.254点击Add3、配置主机名# hostnamectl set-hostname (设置考试要求的主机名)# hostname(查看主机名)二、考试练习题解答破解密码是在配置IP和配置主机名之前进行(我当时的练习系跳过了ip和主机名,虚拟机中已做好)题目1:修改root密码请修改系统的root帐号密码为ooxx9527,确保能够使用root帐号能够登陆系统。
操作步骤:●#reboot 重启系统,在引导界面按“e”,找到“Linux16”这一行,并按“End”键至行尾:输入:空格rd.break●按“Ctrl+X”,开始引导系统,接着输入下列命令:◆# mount –o remount,rw /sysroot (重新挂载)◆# chroot /sysroot (chroot即changeroot)◆# echo “ooxx9527” | passwd –stdin root◆# touch /.autorelabel (自动重写标签)◆# exit◆# exit题目2:设定SeLinux请按下列要求设定系统:SeLinux 的工作模式为enforcing ,要求系统重启后依然生效所用知识:Vim 编辑器: 三种工作模式命令模式Esc插入模式:a ,i ,o末行模式:Shift+: wq 保存退出 q 退出 q !强制退出操作步骤: # vim /etc/sysconfig/selinux (按i 编辑,设定SeLinux=enforcing ,按Shift+:输入wq 保存退出) # getenforce (查看当前Selinux 状态)题目3:设定YUM 软件仓库配置你的本地默认YUM 软件仓库,仓库地址为/content/rhel7.0/x86_64/dvd 操作步骤: # vim /etc/yum.repos.d/el7.repo # yum repolist (查看结果:得到4305即可) 题目4:调整逻辑卷容量 请按照以下要求调整本地逻辑卷lvm1的容量:调整后的逻辑卷及文件系统大小为770MiB调整后确保文件系统中已存在的内容不能被破坏调整后的容量可能出现误差,只要在730MiB - 805MiB 之间都是允许的调整后,保证其挂载目录不改变,文件系统完成。
2023rhcsa题库RHCSA 认证概览Red Hat Certified System Administrator(RHCSA)认证验证了候选人在 Linux 系统管理方面的核心技能和知识。
此认证涵盖核心 Linux 系统管理概念,如用户和组管理、权限管理、文件系统管理、网络配置、包管理和系统引导过程。
考试要求RHCSA 考试代码为 EX294,时长为 2 小时 30 分钟。
它需要考生对以下主题有深入了解:Linux 系统架构和组件用户和组管理权限管理文件系统管理网络配置包管理系统引导过程考试格式RHCSA 考试包含以下类型的考题:多项选择题多选题真假题填空题实际操作任务考试准备资源Red Hat 提供各种资源来帮助考生为 RHCSA 考试做准备,包括:官方 RHCSA 培训课程RHCSA 自学课程实践实验室模拟考试应试策略在准备 RHCSA 考试时,请考虑以下策略:专注于理解核心概念,而不是死记硬背。
积极参与实践练习和实验室。
利用官方资源,如培训课程和学习指南。
定期进行模拟考试以评估您的进度并确定需要改进的领域。
考试提示在参加 RHCSA 考试时,请记住以下提示:仔细阅读每个问题并理解所要求的信息。
如果不确定答案,请标记该问题并稍后返回。
管理好您的时间,确保在所有问题上分配足够的时间。
不要在任何一个问题上花费太多时间,如果卡住了,请继续下一个问题。
RHCSA 认证优势获得 RHCSA 认证可为您的职业生涯带来以下好处:验证您的 Linux 系统管理技能和知识。
提升您的职业发展机会。
为进一步的 Red Hat 认证(如 RHCE)做好准备。
获得行业认可和尊重。
结论RHCSA 认证是证明您具备 Linux 系统管理核心技能和知识的宝贵凭证。
通过遵循适当的准备策略和利用可用资源,您可以成功通过考试并推进您的职业生涯。
RHEL6 的RHCE考试分为RHCSA和RHCE两部分考试时间:RHCSA 2小时30分钟总分300分,210分passRHCE 2个小时总分300分,210分pass考试环境:考试为上机考试,在一台真实机系统中,已经预安装好虚拟机,要求所有的考试题必须在虚拟机中完成。
考题在真机的EXAM图标打开的web界面中一定要把虚拟机中的网络配置好,否则在真机的web界面中看不到考题。
网络必须配置好,如果从网络不能被访问到,则考试也不能通过。
在iptables配置中如需要拒绝访问,请使用REJECT(考试过程中iptables默认策略均为ACCEPT)考试过程中,可以选择语言环境为简体中文考试真机的hostname为,考试虚拟机的hostname为注意:所有的光盘中的软件包已经在/pub/rhel6/dvd下你可以用真实机来验证虚拟机中的考试实验是否正确完成如:域是192.168.1.0/16网络,一般在题意中被要求拒绝的网络。
RHCSA考试题:RHCSA考试时防火墙是打开的,一定要记着关闭防火墙,不然考试肯定不能通过。
0、破解密码打开虚拟机破解密码setenforce 0passwd root或echo 密码| passwd –stdin root1、配置好你的主机名,ip地址,网关,DNS主机名:IP:192.168.0.0/24网关:192.168.0.254DNS:192.168.0.254配置主机名vim /etc/sysconfig/network配置ip地址、网关、DNS、子网掩码vim /etc/sysconfig/network-scriptrs/ifcfg-eth0 IPADDR=192.168.0.10XNETMASK=255.255.255.0GATEWAY=192.168.0.254DNS1=192.168.0.254关闭防火墙system-config-firewall配置yum仓库Vim /etc/yum.repos/server.repo[server]name=serverbaseurl=/pub/rhel6/dvdenabled=1gpgcheck=0yum –y install lftp*2、添加3个用户,用户harry,natasha,sarah,要求harry,natasha用户的附加组为manager组,sarah用户的登陆shell为非交互式shell。
rhcsa考试内容题库
RHCSA(Red Hat Certified System Administrator)考试主要
涵盖以下内容:
1. 系统管理,包括文件系统管理、磁盘管理、文件和目录权限
管理、用户和组管理、进程管理、系统启动和服务管理等。
2. 网络配置和管理,包括网络配置、网络服务配置、防火墙配置、网络故障排除等。
3. 系统安全,包括文件系统安全、用户安全、服务安全、SELinux 配置等。
4. Shell 脚本编写,包括基本的 Shell 脚本编写、命令行操
作等。
5. 软件包管理,包括软件包的安装、升级、删除、查询等操作。
在考试中,你可能会面对各种与上述内容相关的任务和场景,
需要结合实际操作进行解答。
为了顺利通过考试,建议你充分掌握
Red Hat 官方提供的培训教材和实验环境,进行充分的练习和复习。
祝你考试顺利!。
2023rhcsa题库容器化概述容器化是一种虚拟化技术,它允许在单个主机操作系统上运行多个隔离的应用程序。
容器通过隔离应用程序及其依赖项(如文件系统、库和二进制文件)来实现这一点,同时共享操作系统的底层内核。
Red Hat Enterprise Linux 9 中的容器化Red Hat Enterprise Linux 9(RHEL 9)提供了一套全面的工具和技术来支持容器化工作负载。
这些工具包括:Podman:一个命令行界面(CLI)工具,用于管理容器。
CRI-O:一个容器运行时接口(CRI),它提供与 Kubernetes 等容器编排系统的接口。
Buildah:一个用于构建容器镜像的命令行工具。
Skopeo:一个用于检查和复制容器镜像的命令行工具。
创建和管理容器要使用 Podman 创建容器,请使用以下命令:```podman run -it --rm --name my-container <image> ```其中`<image>`是要运行的容器镜像。
要查看正在运行的容器列表,请使用以下命令:```podman ps```要停止运行的容器,请使用以下命令:```podman stop <container-name>```要删除容器,请使用以下命令:```podman rm <container-name>```构建容器镜像要使用 Buildah 构建容器镜像,请使用以下命令: ```buildah bud -t <image-name> <context-directory>```其中`<context-directory>`是包含要构建镜像的文件的目录。
要将容器镜像推送到注册表,请使用以下命令:```podman push <image-name> <registry-address>```Red Hat Container PlatformRed Hat Container Platform(RHCP)是 Red Hat 的企业级容器平台。
LABSDuring the Red Hat exams, the tasks will be presented electronically. Therefore, this book presents most of the labs electronically as well. For more information, see the Lab Questions section toward the end of Chapter 10. Most of the labs for this chapter are straightforward and require a very few commands or changes to one or two configuration files.Lab 1In this lab, you’ll set up a GPG key pair and test the result on the 56510-labs.txt file. This lab requires the use of two different systems. The and systems are ideal for this purpose.1.On the system, copy the 56510-labs.txt file to a regular user homedirectory.2.On the system, create a private-public key pair using RSA encryption.3.Copy the public key to the system, and then import it.4.Encrypt the 56510-labs.txt file.5.Copy the encrypted file to the system.6.Decrypt the 56510-labs.txt file on the system.Lab 2Think about bastion systems. One implicit lesson of this chapter is to minimize what’s installed. In other words, if it isn’t installed, a cracker can’t take advantage of it. This lab uses the rpm commands discussed in Chapter 7. While that is a RHCSA topic, those are fundamental skills for RHCEs. Strictly speaking, this lab does not directly address any RHCE objectives. So if you’re pressed for time, skip this lab. But it does point to a fundamental way to keep a RHEL 6 system secure.To that end, review t he current contents of the /etc/init.d directory. It’s a handy reference point for currently installed services. Don’t uninstall anything at this time. If you don’t recognize a script in the /etc/init.d directory, identify the associated package. For example, to identify the package associated with the abrtd script in that directory, run the following command:$ rpm -qf /etc/init.d/abrtdThat identifies the abrt RPM package. To learn more about that package, run the following command:$ rpm -qi abrtYou don't need all of the services shown in the /etc/init.d directory. Save the results in a text file. For example, I’d include the following scripts from that directory as potential packages to remove:abrtdatdavahibluetoothLab 3You want to configure a firewall to accommodate a secure Web server that supports inbound requests to both the regular and secure Web server protocols. The system should also accept remote communications to the local SSH server. What do you do?Lab 4You want to set up Telnet service on your internal LAN, accessible only to one specific IP address. You want to block access from outside the LAN. Assume that your LAN’s network address is 192.168.122.0, and the IP address of the computer that should get access is192.168.122.150. For the purpose of this lab, feel free to substitute the IP address of a second Linux computer on the local network. What do you do?Lab 5You want to use TCP Wrappers to limit access to the local SSH server. First, what do you do to confirm that SSH can be prot ected by TCP Wrappers? Once you’ve done so, make needed changes to make sure the SSH server on the system can be accessed only from the system.This lab assumes you’ve installed the vsFTP server as discussed in Chapter 1. While the basic installation of an FTP file server is an RHCSA skill, detailed configuration is an RHCE skill discussed in Chapter 16. The focus of this lab starts with the /etc/vsftpd/ftpusers file. As noted in that file, it’s a list of users who are not allowed to log in to the local vsFTP server. For security, it’s an excellent idea to retain the /etc/vsftpd/ftpusers file.The objective of this lab is to configure and limit access through the FTP server to one regular user account.LABSDuring the Red Hat exams, the tasks will be presented electronically. Therefore, this book presents most of the labs electronically as well. For more information, see the Lab Questions section toward the end of Chapter 12. Most of the labs for this chapter are straightforward and require a very few commands or changes to one or two configuration files.Lab 1In this lab, you’ll create a script that backs up all files from the /etc directory to a newly created /backup directory. In practice, you might choose to run that kind of script on a relatively infrequent basis, perhaps weekly. However, for the purpose of this lab, make sure it’s run on an hourly basis.Once the script is configured, you may not have an hour to wait. In that case, run an appropriate date command to move the local clock ahead to the next hour. For example, if the current date is 11:43 A.M. on July 11, the following command sets the current time to noon:$ date 07111200Lab 2In this lab, you’ll disable responses to the ping command, using kernel settings. (On an exam, it would also be acceptable to disable responses to the ping command with the help of the Firewall Configuration tool. But when possible, it’s good to know more than one method.)Make a copy of the /etc/vsftpd/vsftpd.conf file. Set it up as an RPM package, to be installed in the /opt/sampleftp directory.Lab 4Copy the OVERVIEW file from the /usr/share/doc/postfix-2.6.6/README_FILES directory. Set it up as an RPM package, to be installed in the /opt/postfixinfo directory.Lab 5On the system, set up a custom route to the network with the system. Use the same gateway address as the default gateway.Lab 6In this lab, you’ll take the system and set it up as a Kerber os client. Assume the LDAP server is on system 192.168.100.1; the KDC is located on system; and the Kerberos admin server can be found on that same system. Since Kerberos will be used, TLS is not required for LDAP.If the system is on a different subnet, substitute the IPv4 gateway address for the system for 192.168.100.1.LABSDuring the Red Hat exams, the tasks will be presented electronically. Therefore, this book presents most of the labs electronically as well. For more information, see the Lab Questions section toward the end of Chapter 13. Most of the labs for this chapter are straightforward and require a very few commands or changes to one or two configuration files.Lab 1Configure Postfix to enable authentication on the physical host system. Do not make any additional changes to the local system. Make sure e-mails can be sent from user to user locally. Forward e-mails directed to the local root account to a regular account on the local system.Configure the Postfix system in Lab 1 to support access from the network, or the corresponding IP address network. Configure a system on as a Postfix smart host, forwarding to the physical host system.Lab 3Configure the Postfix system in Lab1 to prohibit access from the network (or the corresponding IP address network). Do not allow access from any network other than .Lab 4Set up the sendmail service. Make sure the Postfix service is no longer operational, but keep it ready for use.Lab 5Configure sendmail to accept connections from the local system with both IPv4 and IPv6 addressing. Do not make any additional changes to the local system. Make sure e-mails can be sent from user to user locally. Forward e-mails directed to the local root account to a regular account on the local system.Lab 6Configure the sendmail system from Lab 5 to support access from the network, or the corresponding IP address network. Configure a system on as a sendmail smart host, forwarding to the physical host system.Lab 7Configure the sendmail system configured in Lab 5 to prohibit access from the network (or the corresponding IP address network). Do not allow access from any network other than . IPv6 addressing is not required.RHCSA Sample Exam 2You may either start with the preconfigured RHEL 6 system described in Appendix A. If necessary, make sure that system is currently powered down. As discussed in Appendix A, a current repository of the installation DVD is available from an FTP server configured on the local system. You’ll have two and a half hours to complete the following tasks:1.Install VM software on the local system.e the ks2.cfg file from the Exams/ subdirectory to create a virtual machine. Modify as needed toset up a system with hostname on IPv4 address 192.168.100.101. (If there’s a conflict with other hardware, IP address 192.168.101.101 is an acceptable IPv4 address for.)The additional steps in this exam should be applied to the system. If you were not successful creating an system, it’s acceptable to set it up on the local physical host system.e ssh to access the VM, as if it were a remote system.4.Configure a new partition of 500MB in the available empty space of the drive, formatted to ext4.5.Configure that volume on the new /cooks directory, with the ACL option.6.Set up additional swap space in the remaining empty space of the drive.7.Make sure that the new /cooks directory and swap space are automatically mounted the next timethe system is booted. Use the UUID of the new volume.8.Configure the following users: linus, richard, mark, bill. Deny users bill and richard access to the/cooks directory. Allow access to all other users.9.Set up the automounter, and configure it to read the DVD on the /misc/dvd directory.10.Download a different kernel from the Chapter7/ subdirectory of the book CD. Install that kernel.Make sure the bootloader default points to the original kernel.11.Set up the system to boot by default into runlevel 3.12.Install and configure the vsFTP server with one twist: make sure that anonymous users who connectare sent to the /ftp directory.13.Configure a local NTP server on one virtual machine system. Set this NTP server to point to thephysical host.14.Make sure SELinux is set in permissive mode. (You’re still responsible for any problems related toSELinux.)15.Power down the exam system.。
考试的时候,第一个要做的其实是修改root用户密码,这个没什么可说的,注意的是,所有的题目均在虚拟机中完成!跟物理机没关系!1 进入单用户模式修改密码2 配置网络,将虚拟机的网络配置成和局域网环境相同,也就是使用桥接昨晚上面两个,然后开始做题,时间很紧,还要检查,所以前期一定要仔细,做完之后浏览下就可以了将VGSRV 拉伸为100MBVGSRV这个是逻辑卷的home分区,逻辑卷是可以随意拉伸的,但是需要注意的是拉伸之前必须使用umount卸载,否则系统会崩溃,虽然可以还原但是很麻烦,顺序不可以错df –TH 看home分区是第几个逻辑卷,如我虚拟机里的是/devmapper/GLSvg_GLShome 大小是1Gumount /home 卸载home分区resize2fs /devmapper/GLSvg_GLShome 100M 将home这个分区的文件系统减小到100M 回车之后,系统会提示e2fsck –f /devmapper/GLSvg_GLShome 输入即可然后,重新输入一次resize2fs /devmapper/GLSvg_GLShome 100M 回车之后,home分区的文件系统才真正减小了最后才开始减逻辑卷lvreduce –L 100M /devmapper/GLSvg_GLShome最后,使用mount –a 看看能否挂载起来如果能挂载就表示没问题2 建立组manager新建用户natasha harry 以manager为第二属组新建用户sarah 要求不能有互动式shell,三个用户密码全为thuctive 新建文件夹/command 属于manager组,要求组成员有读写访问的权限其他成员没有任何权限,并且组成员不能删除其他成员的档案要求在/command下创建的档案全部属于manager组这题比较简单,但是需要仔细,1 groupadd manager 新建manager组2 useradd –G Natasha manager 这条指令就是新建娜塔莎用户,并且将属组改成manager3 useradd –G harry manager4 useradd –s /sbin/nologin sarah 新建一个sarah的用户,但是禁止交互式登录5 mkdir /command 创建这个组chgrp manager /command 将command这个文件夹拥有的组改成manager7 chmod g+w /command 组成员具备读写的权限8 chmod o-rw /command 其他用户不具备任何权限9 chmod o+t /command 这个文件夹下的所有文件,只有创建者和root可以删除,别的用户不可以10 chmod g+s /command 这个文件夹下的所有文件都属于manager这个组3 修改sysctl 值为1启用IPforwarding 功能,忽略发往本机的所有icmp包这题比较简单Vim /etc/sysctl.conf 将IPforwarding的值改为1 即可 1 是开启,0是关掉4 从FTP:///pub/rhcsa/kernel 安装适用的软件包----更新版的kernel套件在重新开机后为默认启动----原先的kernel套件依旧存在,并且可以手动启用这题应该先做好下面那题,配置好yum源.然后yum install lftp* , 安装好lftp之后,进入FTP:///pub/rhcsa/kernel ,将指定的内核文件下载过来并且rpm安装lftp 192.168.0.254/pub/rhcsa/kernel get kernel*然后rpm –ivh kerne*安装之后,默认就是以新内核启动,这个不用管,进去看看就行,至于安装源这些,考试时候会告诉你的.5 配置本地yum仓库,yum服务器在instructor上,地址见环境介绍,适用yum安装x3270-x11程序仓库配置比较简单Vim /etc/yum.repo.d/dvd.repo[RHCSA]Name=rhcsaBaseurl=ftp://192.168.0.254/pub/rhel6/dvdEnabled=1Gpgcheck=06 使用者natasha 需建立一个计划任务,在本地时间每天20.45分执行/bin/echo howdy#crontab –u Natasha –e45 20 * * * /bin/echo howdy7 开启LDAP验证LDAP--主机名--搜索基础:DN:dc=example,DC=com--CA证书/pub/example-ca-cert--身份验证方法选择LDAP 适用ID命令确认用户LDAPuserX已经加入这题没有环境,我只能说一下步骤了,没办法验证1 客户机安装openldap-clients2 system-config-authentic 打开操作界面,选择加入LDAP3 填入LDAP的服务器地址以及证书地址勾选TLS加密这些信息上面都有4 使用id ldapuser1 检查是否加入成功8 为LDAP使用者设定autofs 以自动挂载其家目录--LDAPuserx使用者的家目录是://home/guests/ldapuserx--ldapuserx使用者的家目录应该自动挂载在本地端的/home下面的guests/ldapuserx--当您适用ldapuser1~ldapuser20登录系统是,能存取家目录的仅有ldapuserx使用者1 yum install autofs* –y 下载安装自动挂载服务2 vim /etc/auto.master 在最后,加入/home/guests auto.ldap这一行,表示挂载到home下的guests目录下,auto.ldap是辅助挂载文件,有模板3 cp /etc/auto.msic /etc/auto.ldap4 vim /etc/auto.ldap 在CP那一行下面,加入ldapuser1-fstype=nfs,rw:/home/guests/ldapuser1表示键入ldapuser1这个用户的时候,自动挂载服务器上的ldapuser1这个目录到本地的home目录9 复制档案/etc/fstab到var/tmp下,是档案/var/tmp/fstab的拥有者为root,拥有组为root,可以被任何人读,要求natasha可读写,harry不能读写1 cp /etc/fstab /var/tmp/2 chmod o+r 允许任何用户读写3 setfacl –m u:Natasha:rw /var/tmp/fstab 允许娜塔莎具备读写4 Setfacl –m u:harry:0 /var/tmp/fstab harry用户没有任何权限5 getfacl /var/tmp/fstab 检查10 找出所有属于natasha用户的档案,并且把这些档案放到/root/found目录中find / -user Natasha –exec cp –rf {} /root/found/ \; 查找所有用户为natasha的并且复制到root目录下的found中11 创建用户jean,并且设置UID为4332Useradd -u 4332 jean 创建jean用户并且指定UID12 创建一个512MB的SWAP分区,要求自动挂载,系统之前的SWAP依然存在,开机以后依然生效Fdisk –l 查看分区Fdisk /dev/sda 创建一个扩展分区,大小为512M然后创建逻辑分区,Fdisk /dev/sdat 5类型为82 交换分区W 写入然后键入paetx –a /dev/sda然后mkswap /dev/sda4Swapon /dev/sda4Swapon –s 检查然后重写fstab,实现开机挂载13 安装FTP服务器,要求匿名用户可以下载档案yum install vsftpd* -y 安装FTP服务service vsftpd restart 启动FTPchkconfig vsftpd on 确保开机自动启动注意:安装完ftp,默认情况下就是允许匿名上传的,你可以lftp自己的机器验证一下14 建立HTTP服务器,要求功能参数名称为.下载ftp:///pub/rhcsa/station.html,重命名为index.html.放到默认的documentroot桌面,Yum install httpd* -y 安装httpd服务Lftp 192.168.0.254/pub/rhcsaGet station.htmlCp station.html /var/www/html/index.htmlService httpd restartChkconfig httpd onLinks http:// hostname 检查结果15 在档案/usr/share/dict/words照出所有包含strato的列,然后把这些依照原来的次序,copy到/root/lines.txt内,此档案不存在空行,所有copy的行列,内容跟原文一样Cd /usr/share/dictVim words:set nu 标行号Cat words |grep strato >root/lines.txt16 创建一个逻辑组为wgroup.逻辑卷名为wshare,逻辑卷大小为100extent,每个extent为8MB,并且挂载到mnt/wshare,开机有效fdisk –cu /dev/sda创建一个100M的分区T 更改类型为8E然后WPartx –a /dev/sda然后,pvcreate /dev/sda5 转换成物理卷Vgcreate wgroup –s 8M /dev/sda5 创建卷组,并且PE大小为8MB然后lvdisplay 查看结果Lvcreate –l 10 –n wshare wgroupMkfs.ext4 /dev/wgroup/wshare将启动信息写入fstab实现开机挂载Mount –a 查看结果RHCSA至此结束。