You are on page 1of 16

RHCSA

RHCSA
1 root
1)
2) e
3) e
4) 1
5) b
6) runlevel
7) getenforece
8) setenforce 0 permission
9) passwd
10) exit
2
1) /etc/init.d/NetworkManager stop
2) chkconfig NetworkManager off
3) iptables F
4) service iptables save
5) setup Network configuration
6) DNS configuration hostname DNS
7) Device configuration eth0 ipnetmaskGW DNS
8) service network restart
9) ping host.domain90.example.com ping
10) host host.domain90.example.com DNS
3
1) DNS domain90.example.com DNS domain90.example.com
172.24.90.0/255.255.255.0
2) Hostname: station.domain90.example.com
3) IP address: 172.24.90.10
4) Netmask: 255.255.255.0
5) Gateway: 172.24.90.254
6) Name server: 172.24.90.254
7) root nimsdreg
4 ssh root@172.24.90.10 X
RHCSA
ssh root@172.24.90.10 X
1 YUM http://server.domain90.example.com/pub/x86_64/Server,

cd /etc/yum.repos.d/
#
vim aa.repo
# repo
name=aa
baseurl=http://server.domain90.example.com/pub/x86_64/Server
enabled=1
gpgcheck=0
1 / 16

yum clean all


yum install system-config-lvm -y

#
# yum

2 vo 290M
260M 320M

system-config-lvm
#
---

3
a) sharegrp
b) natasha sharegrp
c) harry sharegrp
d) sarah shell sharegrp natashaharrysarah
nimsdreg

groupadd sharegrp
#
useradd G sharegrp natasha
# natasha sharegrp
useradd G sharegrp harry
# harry sharegrp
useradd s /sbin/nologin sarah
# shell
passwd natasha
#
passwd harry
passwd sarah
4 /var/tmp/fstab /etc/fstab /var/tmp/fstab/var/tmp/fstab
a) /var/tmp/fstab root
b) /var/tmp/fstab root
2 / 16

c) /var/tmp/fstab
d) natasha /var/tmp/fstab
e) harry /var/tmp/fstab
f) /var/tmp/fstab

setfacl m u:natasha:rw- /var/tmp/fstab


setfacl m u:harry:--- /var/tmp/fstab
5 cron natasha cron job 14:23
* /bin/echo hiya

crontab e u natasha
23 14 * * * /bin/echo hiya
#i:x
crontab l u natasha
#
6 /home/shared
a) /home/shared sharegrp
b) sharegrp root

c) /home/shared sharegrp

mkdir /home/shared
#
ls ld /home/shared
#
chgrp sharegrp /home/shared
# sharegrp
chmod g+w /home/shared
# w
chmod o-rx /home/shared
# rx
chmod g+s /home/shared
# sharedgrp
7 ftp://server.domain90.example.com/pub/updates
a)
b)

yum install firefox y


# firefox
kill -9 3816
# yum 3816
pid 3816
firefox
# firefox
firefox root

rpm ivh kernel-*


# root

vim /boot/grub/grub.conf
#
uname r
#

[li1]:

8 host.domain90.example.com LDAP

a) DN dc=domain90,dc=example,dc=com
3 / 16

b) LDAP
c) ftp://host.domain90.example.com/pub/domain90.crt
ldapuser90 autofs ldapuser90
password

wget ftp://host.domain90.example.com/pub/domain90.crt
# wget
yum install wget
setup
#

LDAP LDAP
ldap://host.domain90.example.com
dc=domain90,dc=example,dc=com
TLS

id ldapuser90

#
#

9 NTP server.domain90.example.com NTP

system-config-data
#

NTP
server.domain90.example.com
10
a)

autofs LDAP
host.domain90.example.com(172.24.90.250) NFS /netdir
ldapuser90
ldapuser90 host.domain90.example.com:/netdir/ldapuser90
ldapuser90 /netdir /netdir/ldapuser90

ldapuser90 password

b)
c)
d)
e)

vim /etc/auto.master
/- /etc/auto.aa
#/misc /netdir /etc/auto.aa,
auto.aa ldapuser90
cp /etc/auto.misc /etc/auto.aa
#
vim /etc/auto.aa
#
/netdir/ldapuser90 fstype=nfs,rw host.domain90.example.com:/netdir/ldapuser90
# cd ,
autofs vers=3 rw vers=3
service autofs restart
# autofs
su ldapuser90
# ldapuser90
df h
#
chkconfig autofs on
#
11

FTP station.domain90.example.com ftp anonymous /var/ftp/pub

4 / 16

[li2]:

yum install vsftpd y


# ftp
service vsftpd start
#
chkconfig vsftpd on
#
touch /var/ftp/pub/aa.txt
# aa.txt
ftp:// station.domain90.example.com/pub/

# ftp

12
web http://station.domain90.example.com web

a) ftp://server.domain90.example.com/pub/rhcsa/station.html
b) index.html
c) index.html web DocumentRoot
d) index.html

yum install httpd\* -y


# web
vim /etc/httpd/conf/httpd.conf
#
ServerName station.domain90.example.com:80 # ServerName
service httpd restart
#
chkconfig httpd on
#
wget ftp://server.domain90.example.com/pub/rhcsa/station.html
#
mv station.html /var/www/html/index.html
#
restorecon R /var/www/html/
http://station.domain90.example.com
restorecon chcon
restorecon

13
aclanuid 3895 nimsdreg

useradd u 3895 aclan


#-u uid 3895 aclan
passwd aclan
#
14
swap 756M

dd if=/dev/zero of=file bs=1M count=756


# 756M
mkswap file
swapon file
vim /etc/fstab
#
/root/file
swap
swap
defaults 0 0 #
cat /proc/swaps
# file free l swapon s
15
julia /root/findresults

mkdir /root/findresults
# findresults
find / -user julia exec cp a {} /root/findresults/ \;
#/
julia /root/findresults
5 / 16

[li3]:

,-a -rfp
16
/usr/share/selinux/devel/include/kernel.xml entry
/root/lines /root/lines
/usr/share/selinux/devel/include/kernel.xml

grep entry /usr/share/selinux/devel/include/kernel.xml > /root/lines # > >>

17

a) engineering development 20
b) development 32MiB
c) vfat /mnt/engineering.

fdisk /dev/sda
# svda
p
#
n
#
p
#
1
+800M
# 800M
w
#
partx a /dev/sda
# xvda partx a file
system-config-lvm
#

devlopment 32M
devlopment engineering
20 vfat ext2ext3ext4

mkfs.vfat /dev/development/engineering
# vfat
mkdir /mnt/engineering
#
vim /etc/fstab
#
/dev/development/engineering /mnt/engineering
vfat
defaults 0 0
mount a
#

netstat ntulp
# 8021

6 / 16

RHCE
RHCE(selinux)
IPDNS
IP: 172.24.90.10/24
station.domain90.example.com
domain90.example.comt3gg.com---172.25.0.0/16
yum
ssh root@ 172.24.90.10 X
cd /etc/yum.repos.d/
vim aa.repo
[aa]
name=aa
baseurl=http://server.domain90.example.com/pub/x86_64/Server/
enabled=1
gpgcheck=0
yum clean all
yum install gcc y
#yum
iptables F
#
service iptables save
#

1SELinuxselinuxEnforcing

getenforec
#
vim /etc/selinux/config
#
SELINUX=enforcing
#enforcing
setenforce 1
#enforcing
2IP forwardingip forward

vim /etc/sysctl.conf
net.ipv4.ip_forward = 1 #01
echo 1 > /proc/sys/net/ipv4/ip_forward
#
3cron accessmarjoriecron

vim /etc/cron.deny
marjorie
#
su Marjorie
crontab e
#
4FTP accessstation.domain90.example.comFTP
FTP/var/ftp/pub
domain90.example.comFTP

7 / 16

yum install vsftpd y


service vsftpd restart
chkconfig vsftpd on
vim /etc/hosts.allow
vsftpd: 172.24.90.

vim /etc/hosts.deny
vsftpd: ALL

#ftp
#ftp
#
#
#172.24.90
#
#

5SMTPSMTP

harry
harryharry/var/spool/mail/harry

vim /etc/postfix/main.cf
inet_interfaces = all
#,113
#inet_interfaces = localhost #116
service postfix restart
#
netstat ntulp | grep :25
#
postconf myhostname
#station.domain90.example.com.

vim /etc/postfix/main.cf
mydestination = station.domain90.example.com #
station.domain90.example.com
echo aaa | mail s aa harry@station.domain90.example.com #station
mail u harry
#harry

[li4]: postconf
myhostname

6an email aliasMTAadminnatasha

vim /etc/aliases
#
admin: natasha
#
newaliases
#
echo aaa | mail s aa admin@station.domain90.example.com
#admin
mail u natasha
#natasha
chkconfig postfix on
#
7SMBSMB/common:
SMBSTAFF
common
commondomain90.example.com
common
harrynimsdreg

mkdir /common
chcon R t samba_share_t /common
#
yum install samba y
#samba
service smb start
#smb
8 / 16

[li5]:
windows samba

chkconfig smb on
#
vim /etc/samba/smb.conf
#
workgroup = STAFF
#workgroup = STAFF
[common]
#
path = /common
#
iptables I INPUT 1 p tcp ! s 172.24.90.0/24 -dport 445 j REJECT #
tcp 445
service iptables save
#
vim /etc/samba/smb.conf
#
browseable = yes
#[common]

smbpasswd a harry
#harrysmbsmbpasswd x
harry
smbclient -L //station.domain90.example.com -U harry
#harry

smbclient //station.domain90.example.com/common -U harry


#common

8NFSNFS/commondomain90.example.com
root/commonautofs
/net/station.domain90.example.comNFS

root
vim /etc/exports
#nfs
/common
172.24.90.0/24(rw,sync)
#172.24.90.0rwsync
exportscommonother
w
service nfs restart
#
chkconfig nfs on
#
showmount e station.domain90.example.com #-e=--exports,
df h
#
cd /net
#/net
ls
#
cd station.domain90.example.com
#
autofsnfs
ls /net
#station.domain90.example.com
9SSHSSH
harrydomain90.example.comSSH
my133t.orgssh

vim /etc/hosts.allow
#
sshd: 172.24.90.
#172.24.90ssh
vim /etc/hosts.deny
#
sshd: 172.25.0.
#
10webhttp://station.domain90.example.comweb
9 / 16

[li6]:

[li7]: sshd
[li8]:

ftp://server.domain90.example.com/pub/rhce/station.html
index.html
index.htmlwebDocumentRoot
index.html

yum install httpd\* -y


#web
chkconfig httpd on
#
vim /etc/httpd/conf/httpd.conf
#
ServerName station.domain90.example.com:80
#
service httpd restart
wget ftp://server.domain90.example.com/pub/rhce/station.html

mv station.html /var/www/html/index.html
restorecon R /var/www/html/
http://station.domain90.example.com #
11webhttp://www.domain90.example.com

DocumentRoot /var/www/virtual
ftp://server.domain90.example.com/pub/rhce/www.html
index.html
index.htmlDocumentRoot
index.html
harry/var/www/virtual
http://station.domain90.example.com
server.domain90.example.comwww.domain90.example.comDNS

vim /etc/httpd/conf/httpd.conf
#
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin
#
DocumentRoot /var/www/virtual
#
ServerName www.domain90.example.com
#
ErrorLog
#
CustomLog
#
</VirtualHost>
#

<VirtualHost *:80>
#
DocumentRoot /var/www/html
#
ServerName station.domain90.example.com
#
</VirtualHost>
#
wget ftp://server.domain90.example.com/pub/rhce/www.html
mkdir /var/www/virtual
mv www.html /var/www/virtual/index.html
chcon R reference=/var/www/html/ /var/www/virtual/
#
setfacl m u:harry:rwx /var/www/virtual/
#harryvirtual
service httpd restart
#
http://www.domain90.example.com
10 / 16

[li9]:

[li10]:

chkconfig httpd on

12webDocumentRootconfidential
ftp://server.domain90.example.com/pub/rhce/station.htmlindex.html
confidential

mkdir /var/www/html/confidential
#DocumentRoot
mkdir /var/www/virtual/confidential
#DocumentRoot
wget ftp://server.domain90.example.com/pub/rhce/station.htmlindex.html
cp station.html /var/www/html/confidential/index.html
cp station.html /var/www/virtual/confidential/index.html
vim /etc/httpd/conf/httpd.conf
#
<Directory> </Directory>, #

62Allow ::1localhost

[li11]: allow

service httpd restart


#
127.0.0.1/confidential
chkconfig httpd on
13/root/script.sh
/root/script.sh all,none.
/root/script.sh noneall.
allnone
/root/script.sh all|none

vim /root/script.sh

11 / 16

[li12]:
echo/root/script.sh all|none

chmod +x script.sh

14/root/disc.iso/mnt/virtdisk.

mkdir /mnt/virtdisk
vim /etc/fstab

mount a
df h

#fstab
#

15 kernctl5
/proc/cmdline.

vim /boot/grub/grub.conf
kernctl=5

16iSCSIhost.domain90.example.comiSCSI3260iSCSI

iSCSI1400MiBext4
/mnt/data.
ftp://server.domain90.example.com/pub/iscsi.txtroot,
0644.
.

yum install iscsi\* -y


iscsiadm m discovery t st p host.domain90.example.com
#
iscsiadm m node
#,

12 / 16

fdisk l
# sda xvda, sda sda
sdb
xvda sda sda1 sda2

fdisk

fdisk /dev/sdb
# sda
n
p
1
+1400M
w
partprobe /dev/sdb
fdisk l /dev/sdb
#/sda

mkfs.ext4 /dev/sdb1

# sda1 sda2

ls

vim /etc/fstab

13 / 16


reboot f
1 chkconfig
2 station

ls /mnt/data/

ftp

http

SELinux

1
14 / 16


FTP

pub ftp ok

kernctl 5

samba
1

15 / 16

16 / 16

You might also like