Professional Documents
Culture Documents
Paractice RHCSA
Paractice RHCSA
#su - Eric
4.Configure FTP access on your Virtual Machine to allow permission for
Anonomous User.
Answer:
#yum install -y vsftpd*
#yum install -y ftp*
#vim /etc/vsftpd/vsftpd.conf
anonymous_enable=YES
:wq!
#vim /etc/vsftpd/ftpusers
Remove complete line if anonymous user is present
:wq!
#vim /etc/vsftpd/user_list
Remove complete line if anonymous user is present
:wq!
#service vsftpd restart
#chkconfig vsftpd on
#chkconfig --list vsftpd
To Verify :
#ftp 192.168.0.101
Username: anonymous
Password: -nullftp>bye
#
5.Make a collaborative directory /redhat/cms and set the permissions as:
Group ownership of /redhat/cms is sysadmin. The directory should be
readable, writable, and accessible to members of sysadmin, but not to any
other user.(it is undershould that root has to all files and directories on the
system)Files created in redhat/cms automatically have group ownership set to
sysadmin.
Answer:
#mkdir -p /redhat/cms
#ls -ld /redhat/cms
#groupadd sysadmin
#chown .sysadmin /redhat/cms OR #chgrp sysadmin /redhat/cms
#chmod 770 /redhat/cms
#chmod g+s /redhat/cms (OR) #chmod 2770 /redhat/cms
6. Copy the file /etc/fstab to /var/tmp. Configure the permissions of
/var/tmp/fstab so that ;
The file /var/tmp/fstab is owned by the root user
The file /var/tmp/fstab is belongs to group root
/bin/echo ciao
#vi /etc/auto.master
:set nu
Line 7: /misc /etc/auto.misc
Line 8: /home/guests /etc/auto.ldap
:wq!
Answer:
#free -m
#fdisk -l
#fdisk -cu /dev/vda
Follow the sequence:
:p -- print
:n -- create new partition
:p -- primary partition
:3 -- partition number 3
: -- first cylinder : default press enter
:+500M last cylinder value
:p -- print
:t -- change the file system type
:3 -- partition number 3
:L -- List type of partitions available
:82-- Linux Swap
:p -- print
:w -- save
#reboot
#mkswap /dev/vda3
#swapon /dev/vda3
#blkid /dev/vda3
#vim /etc/fstab
UUID="XXXX-XXXX-XXXX-XXXX swap swap defaults 0 0
#mount a
To Verify:
#swapon s
14.Add a user necola with uid 1212, Set password as lotanecola
Answer:
#useradd -u 1212 necola
#passwd necola
Enter New Passwd: lotanecola
Reenter Passwd : lotanecola
To verify:
#cat /etc/passwd
15. Locate all files and directories of user jacob and copy it to /root/findfiles
Answer:
#find / -user jacob -exec cp -rvp {} /root/findfiles/ \;
16. Find all lines contain a string localhost in a file /etc/hosts and copy it to
/root/list.
Don't leave a free line in /root/list
Answer:
#cat /etc/hosts|while read line;
do
echo $line|grep localhosts|tee -a /root/list
done
or
grep localhost /etc/hosts >root/list
17. Create a Logical Volume partition, Below mentioned the conditions:
Volume Group is 51MB and name as vol0
Logical Volume is 8MB and name as lv0
File type is vfat and permanently mounted to /cms file system
Answer:
#fdisk -l
#fdisk -cu /dev/vda
p --print for available partitions
n --create a new partition
e --extended partition
First cylinder Default: enter
Last Cylinder Value : enter
p --print for available partitions
n --create a new partition
: enter : default value for first cylinder
:+54M last cylinder value
:p -- print
:t -- change the filesystem type
:5 -- partition number 5
:L -- List type of partitions available
:8e-- Linux LVM
:p -- print
:w -- save
#reboot
w --save
#pvcreate /dev/vda5
#vgcreate vol0 /dev/vda5
#lvcreate -L 8M -n /dev/vol0/lv0 vol0
#mkfs.vfat /dev/vol0/lv0
#mkdir /cms
#blkid /dev/vol0/lv0
#vim /etc/fstab
#fdisk -l
#fdisk -cu /dev/vda
p --print for available partitions
n --create a new partition
e --extended partition
First cylinder Default: enter
:+1000M last cylinder value
:p -- print
:t -- change the filesystem type
:6 -- partition number 6
:L -- List type of partitions available
:8e-- Linux LVM
:p -- print
:w -- save
#reboot
#pvcreate /dev/vda6
#vgcreate -s 16M Vgi /dev/vda6
#vgdisplay
#lvcreate -l 60 -n /dev/Vgi/Lvi Vgi
#lvdisplay
#mkfs.ext4 /dev/Vgi/Lvi
#mkdir -p /record
#blkid /dev/Vgi/Lvi
#vim /etc/fstab
UUID"XXXX-XXXX-XXXX-XXXX" /record ext4 defaults 0 0
wq!
#mount -a
To verify:
#df -h
19. Download ftp://192.168.0.254/pub/boot.iso to /root, and mounted
automatically under
/media/cdrom and which take effect automatically at boot-start.
Answer:
#cd /root
#wget ftp://192.168.0.254/pub/boot.iso
#mkdir -p /media/cdrom
#vim /etc/fstab
/root/boot.iso /media/cdrom iso9660 ro,loop,auto 0 0
#mount -a
OR
#mount -t iso9660 /root/boot.iso /media/cdrom
@@@@@@