Académique Documents
Professionnel Documents
Culture Documents
Terminal open"
Alt+f2
Initial setup:
---------------
password break:
restart system
----> press esc key
linux...
--- > press e
----> fi ( line not enter)
----> linux16 /boot/vmliuz ----> go to end of the line and enter
below the comond
rd.break console=tty1
---->ctrl+X
switch_root:# mount -o remount,rw /sysroot
switch_root:# chroot /sysroot
sh-4.2# passwd
newpasswd:
retypepasswd:
sh-4.2#touch /.autorelabel
sh-4.2# exit
switch_root:#exit
--------------
---------------
[admin]
name=adminrepo
baseurl=http://content.example.com/rhel7.0/x86_64/dvd
gpgcheck=0
enabled=1
[root@server6 yum.repos.d]# yum clean all
[root@server6 yum.repos.d]# yum clean dbcache
[root@server6 yum.repos.d]# yum repolist all
----------------------------------------------------------------
question and answer:
---------------------------------------
1.configure your systems that should be running Enforcing
Ans:
[root@server11 ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing
SELINUXTYPE=targeted
-------------------
Ans:
[root@server11 ~]# mkdir /gluster
[root@server11 ~]# lsblk
[root@server11 ~]# fdisk /dev/vdb
Command (m for help): p
Command (m for help): n
Select (default p): e
Partition number (1-4, default 1): enter
First sector (2048-20971519, default 2048): enter
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-20971519, default
20971519): enter
Using default value 20971519
Partition 1 of type Extended and of size 10 GiB is set
Command (m for help): n
Select (default p): l
Adding logical partition 5
First sector (4096-20971519, default 4096): enter
Using default value 4096
Ans:
----
[root@server11 ~]# fdisk /dev/vdb
Command (m for help): n
Select (default p): l
Adding logical partition 6
First sector (200704-20971519, default 200704): --> enter
Using default value 200704
Last sector, +sectors or +size{K,M,G} (200704-20971519, default
20971519): +150M
Partition 6 of type Linux and of size 150 MiB is set
Ans:
-------------------
5.create the following user, groups, and group memberships:.
Ans:
[root@server11 ~]# groupadd sysgrp
[root@server11 ~]# useradd -G sysgrp andrew
[root@server11 ~]# useradd -G sysgrp susan
[root@server11 ~]# useradd -s /sbin/nologin sarah
Ans:
[root@server11 ~]# mkdir -p /redhat/sysgrp
[root@server11 ~]# ls -ld /redhat/sysgrp
drwxr-xr-x. 2 root root 6 Jan 4 06:09 /redhat/sysgrp
Ans:
----
[root@server11 /]# cd /etc/yum.repos.d/
[root@server11 yum.repos.d]# ls
[root@server11 yum.repos.d]# vim kernel.repo
[kernel]
name=kernelrepo
baseurl = http://content.example.com/rhel7.0/x86_64/errata
gpgcheck=0
enabled=1
Ans:
[root@server11 ~]# vim /etc/sysctl.conf
[root@server11 ~]# sysctl -p
net.ipv4.ip_forward = 1
----------------
9. The user andrew must configure a cron job that runs daily at 14:23
local time and executes - /bin/echo hiya .
Ans:
[root@server11 ~]# yum install cron* -y
[root@server11 ~]# systemctl restart crond.service
[root@server11 ~]# crontab -eu andrew
-------------------------
----> next
[*] use TLS
server : ldaps:classroom.example.com
Base DN: dc=example,dc=com
-----> Next
(or)
-----------
11.configure autofs to automount the home directories of LDAP users,
Note the following:
-->while you are able to login as any of the users ldapuser1 through
ldapuser20 the only home directory that is accessible from your system
is ldapuserX.
/misc /etc/auto.misc
/home/guests /etc/auto.misc
[root@server11 ~]# systemctl restart autofs
[root@server11 ~]# su - ldapuser11
--------------
---------------
13. copy the file and configure
--->copy the file /etc/fstab to /var/tmp configure the permission
of /var/tmp/fstab so that the file /var/tmp/fstab is owned by the root
user, belongs to the group root should not be executable by anyone.
--->The user andrew is able to read & write /var/tmp/fstab The user
susan can neighter write nor read /var/tmp/fstab All other users
(current or future) have the ability to read /var/tmp/fstab.
Ans:
----
[root@server5 ~]# cp -rvf /etc/fstab /var/tmp/
---------------------
14.create a new physical volume, create a new volume group in the name
of datacontainer, vg extent is 16.00MB .
create a new logical volume in the name of datacopy with the size of
50 extents and file system must vfat then mount it under /datasource
Ans:
----
[root@server11 ~]# fdisk /dev/vdb
Command (m for help): p
Command (m for help): n
l logical (numbered from 5)
Select (default p): l
----------------
Ans:
----
[root@server11 ~]# useradd -u 2985 talusan
[root@server11 ~]# id talusan
[root@server11 ~]# useradd julies
[root@server11 ~]# find / -name julies
/var/spool/mail/julies
/home/julies
--------------------------
Ans:
----
[root@server11 ~]# umount /dev/datacontainer/datacopy
[root@server11 ~]# e2fsck -f /dev/datacontainer/datacopy
[root@server11 ~]# resize2fs /dev/datacontainer/datacopy 400M
[root@server11 ~]# lvreduce -L 400M /dev/datacontainer/datacopy
---------------------
18.search the string sarah in the /etc/passwd file and save the output
in /root/lines
Ans: