RHCSA 整理

合集下载

RHCSA_3

RHCSA_3

RHCE课程-初级部分7、文件的搜索及高级文件权限和用户、组操作今天的第一个命令:whichwhich显示一个可执行文件的完整路径,按照alias $PATH的顺序查找比如我们看 ls 的可执行文件放在哪的上面一行的ls的别名,默认是加入了--color=tty的参数,下面一行/bin/ls 就是ls 的可执行文件。

我们可以去看看。

青色的一般都是可执行文件。

而且这个青色就是ls 的第一个别名的原因,如果没有这个别名,默认是不会显示颜色.which这个命令在系统管理中有重要,大家一定要记住.下一个命令,whereis ,这个功能就更强大了whereis 搜索一个可执行工具及其相关配置、帮助前面ls: 是表示查找的这个命令/bin/ls 是可执行文件位置后面两个就是帮助文件了下面还是命令:find功能超级大的搜索工具。

语法:find [路径] [参数] [表达式]下面是find常用的参数:-user:根据文件拥有者寻找文件-group:根据文件所属组寻找文件-name:根据文件名寻找文件-perm:根据文件权限寻找文件-size:根据文件大小寻找文件-type:根据文件类型寻找文件,参数对应c、b、l、f、d-o :表达式或-not :表达式非现在我们测试第一个user参数,查找/home 下所有者为root的文件:find /home -user root然后查找/etc下面与root有关的文件:find /etc -user root如果有太多的文件,屏幕无法显示,我们可以用上节课学过的>重定向命令find /etc –user root > file1 这样我们可以去file1文件里面详细看了。

要学以致用。

呵呵!!!第二个参数-group:根据文件所属组寻找文件,找/boot 目录下root组的文件name:根据文件名寻找文件,查找网卡配置文件find / -name ifcfg-eth0这个命令就可以找到网卡的配置文件,-perm:根据文件权限寻找文件,下图是我去查找文件权限为755的文件。

RHCE考试题与解答.doc

RHCE考试题与解答.doc

RHCSA考试题:1、配置好你的主机名,IP地址,网关,DNS主机名:IP:172.24.40.40/24网关:172.24.40.1DNS:172.24.40.1直接编辑配置文件或者使用setup配置网络,过程略2、添加3个用户,用户harry、natasha、tom,要求harry、natasha用户的附加组为admin 组,tom用户的登陆shell为非交互式shell。

useradd harry; passwd harryuseradd natasha; passwd natatshauseradd tom; passwd tomgroupadd adminusermod -a -G admin harryusermod -a -G admin natashausermod -s /sbin/nologin tom3、在/home下创建一个目录,名为admins,要求所属组为admin组,组成员可以读写,其它用户没有任何权限,同组成员在目录下创建的文件的所属组也为admin组。

mkdir /home/admins; cd /homechgrp admin adminschmod -R 770 adminschmod g+s admins4、配置任务计划每天的14:23分,执行echo hello 命令。

crontab -e23 14 * * * /bin/echo hello5、找出harry拥有的文件,拷贝到目录/opt/dir下。

mkdir /opt/dirfind / -user harry -exec cp -a {} /opt/dir \;6、从文件/etc/testfile中找出包含abcde的行,写入到文件/tmp/testfile中,要求顺序与/etc/testfile中一致。

cat /etc/testfile |grep ‘abcde’ > /tmp/testfile7、创建一个2G的交换分区,并开机自动生效,但不影响原有的swap分区。

(完整版)rhcsa考试题库

(完整版)rhcsa考试题库

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等文件在这个分区上。

【Redhat7真题】RHCSA共计18题全20180207

【Redhat7真题】RHCSA共计18题全20180207

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认证题库

rhcsa认证题库

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。

(完整版)rhcsa考试题库

(完整版)rhcsa考试题库

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等文件在这个分区上。

rhcsa考题超级详细解析

rhcsa考题超级详细解析

rhcsa考题超级详细解析标题:RHCSA考题超级详细解析引言概述:RHCSA(Red Hat Certified System Administrator)是红帽认证的系统管理员考试,对于想要在Linux系统管理领域取得认证的人来说,RHCSA考试是必不可少的一步。

本文将对RHCSA考题进行超级详细解析,帮助考生更好地理解考试内容和要点。

正文内容:1. 系统安装与配置1.1 安装系统:详细介绍如何安装Red Hat Enterprise Linux系统,包括选择适合的版本、硬件要求和分区设置等。

1.2 系统初始化配置:解释如何进行系统初始化配置,包括创建用户、设置主机名、配置网络和安全设置等。

1.3 硬件设备管理:讲解如何管理硬件设备,包括添加和删除设备、配置设备驱动程序以及解决硬件故障等。

2. 系统管理与维护2.1 用户和组管理:详细介绍如何创建和管理用户和组,包括添加、删除、修改用户和组的属性,以及设置用户和组的权限等。

2.2 文件系统管理:解析如何管理文件系统,包括创建、挂载和卸载文件系统,以及设置文件系统的属性和权限等。

2.3 进程管理:讲解如何管理系统中的进程,包括启动、停止和监控进程,以及查看和调试进程等。

3. 网络服务管理3.1 网络配置管理:详细介绍如何配置网络,包括设置IP地址、网关、DNS解析和网络接口等。

3.2 远程登录管理:解析如何管理远程登录服务,包括配置SSH服务、访问控制和远程登录日志等。

3.3 网络服务管理:讲解如何管理常见的网络服务,包括HTTP、FTP、DNS和DHCP等,涵盖服务的安装、配置和维护等。

4. 安全管理4.1 用户认证与授权:详细介绍如何进行用户认证与授权管理,包括使用PAM 模块、设置密码策略和访问控制等。

4.2 文件和目录权限管理:解析如何管理文件和目录的权限,包括修改权限、设置访问控制列表和使用特殊权限等。

4.3 安全审计与日志管理:讲解如何进行安全审计与日志管理,包括配置审计规则、监控日志和分析日志等。

rhcsa考试题

rhcsa考试题

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!。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

THE RHCSA EXAMINATION1 Configure the hostname, ip address, netmask, gateway and DNS with the following components:HOSTNAME: IP: 192.168.0.100+XNETMASK: 255.255.255.0GATEWAY: 192.168.0.254DNS: 192.168.0.254IP: Vim /etc/sysconfig/network-scripts/ifcfg.eth0DNS: Vim /etc/resolvesHOSTNAME: Vim /etc/sysconfig/network2 Create three user accounts with the following attributes:User name: harry, natasha,tomharry and natasha will have the appended group named admin, the login shell of tom will be the noninteractive shell.Useradd –G admin harryUseradd –G admin NatashaUseradd –s /sbin/nologin tom3 Create a directory named admins in the location /home, and the group-owner is admin, the members in the group will have access to read and write. The others will have not any privileges. The users in the same group (admin) can create files in the directory and also with the group-owner admin.Mkdir /home/adminsChgrp admin /home/adminsChmod 770 /home/adminsChmod g+s /home/admins4 Configure the plan and task: 14:23 , everyday, execute the command:/bin/echo "Good morning!"Crontab –eCrontab –l 查询验证5 Search all the documents which the owner attributes is harry , then copy them to /opt/dir.Find / -user harry –exec cp –rp {} /opt/dir \;6 Find all the lines including "gedit" frome /etc/testfile, and write them into /tmp/testfile with the same order of its being in the /etc/testfile.Cat /etc/testfile | grep gedit > /tmp/testfile7 Create a swap space with 2G capacity, and autoactivate when start the computer. but won't effect the primary swap space.Fdisk /dev/vdaN --- p--- +2G----t ---X---82Partx –a /dev/vdaMkswap /dev/vdaXVim /etc/fstab/dev/vdaX swp swp default 0,0Swapon –afree8 Create an user alex with the UID 1234, and the password is alex111Useradd –u 1234 alex9 Install a FTP server, and anonymous downloading is allowed from /var/ftp/pubVim /etc/yum.repos.d/x.repo 文件Yum –y install vsftpd/etc/init.d/vsftpd startChkconfig vsftpd on10 Configure a http server, and it can be accessed through , the released page can be downloaded from /pub/ex200/example.htmlYum –y install httpdCd /var/www/htmlLftp 192.168.0.254Cd /pub/ex200Get example.htmlExitMv example.html index.html/etc/init.d/httpd restartChkconfg httpd on再浏览器中输入验证/pub/ex200/example.html11 Configure the host account, and with LDAP for the password authentication. successfully login in ldapuserX,and the password of ldapuserX is: redhat. LDAP SERVER : ldap://TLS/SSL CERT : /pub/cacert-ca.crtRpm –qa | grep openldapSystem-config-authentication 图形化Getent passwd ldapuser20Su – ldapuser2012 Configure autofs, when ldapuserX login successfully, it will have its homedirectory /rhome/ldapuserX. the home directory is shared to /rhome/ldapuserX by nfs in 192.168.0.254.Vim /etc/auto.master/rhome /etc/auto.homeCp /etc/auto.misc /etc/auto.homeVim /etc/auto.homeLdapuser20 -fstye=nfs 192.168.0.254Showmount –e 192.168.0.254/etc/init.d/autonfs reloadSu – ldapuser2013 Configure your system time, which is synchronous with 192.168.0.254System-config-date14 There is a logic volume named vo, change its capacity from 190M to 300M,and the capacity scope is 280~320M ( the lv has been mounted in advance).Df –hVgsLvextend –L 300M /dev/vgsrv/voResize2fs /dev/vgsrv/vo15 Create a volume group named vgrhce, the physical extent is 16M, create a lv named lvrhce with the capacity of 50 PEs. Format the device as an ext4 filesystem, and mount automatically to /mnt/data when start the system.fdisk /dev/vdapartx –a /dev/vdapvcreate /dev/vdaXvgcreate vgrhce –s 16M /dev/vdaXlvcreate –l 50 –n lvrhce vgrhcemkfs.ext4 /dev/vgrhce/lvrhcevim /etc/fstab/dev/vgrhce/lvrhce /mnt/data default 0,016 Upgrade the kernel 2.6.32-131 , set the kernel to be the default kernel, and keep the old kernel available.The new kernel rpm file can be downloaded fromftp:///pub/ex200/kernelUname –rLftp Cd /put/ex200Get kernelExitYum localinstall kernelVim /boot/grub/grub.conf 验证是否有多个KERNEL破解root 密码Init 5虚拟机开启防火墙解除System-config-firewall (图形化)选distable 关闭Iptables –L 查看是否清楚默认规则Selinux 状态设置Vim /etc/selinux/config。

相关文档
最新文档