you system is going to use as a router for two networks , one network is 192.168.0.0/24 and
anoher network is 192.168.1.0/24.both network IP address has asinged . how will you forward
the packets form one network to another network? Correct Ans-vi /proc/sys/net
Automount two senarios ... 1 nfsdata mount automaticall 2- mount /users/user1 /user/user2
automatically. both are presented from master nfs server. Correct Ans-AUTOMOUNT
2 stpes
=======
/etc/auto.master
first you nee to edit the master confighuratin file (/etc/auto.master) in this file you identify the
mount point from the master remote server ( for instance, /nfsdata )next on the same line you
identify the name of the secondary frile, as all further configuration happens in this secondary
file. the line create could looks as follow
/nfsdata /etc/auto.nfsdata
in the secondary file you put the name of the subdirectory that will be created in the mount
point directory as a relative filename. for instance you start the line with files , to mount
/nfsdata/files . after the name of he subdirectory you specify NFS mount option , as well as
serer and share name to access the NFS share.
Files -rw server2:/nfsdata
LAB1 configuring direct and indeirect maps to mount NFS shares
---------------------------------------
1- install autofs
,yum install -y autofs
2-check the remote NFS master server is providing the mountpoints
showmount -e server2.example.com
3- create a mapping file in /etec/auto.master
/nfsdata /etc/auto.nfsdata
4- create aa file /etc/auto.nfsdata
files 192.168.55.150:/data
the system will create the automatically files folder and nfsdata
the system will create /nfsdata automatically on the system.
you need to do
cd /nfsdata/files
-------
mount the user directory from nfs server
in /etc/export file you have entery of
/users
in users you have already user1 and user2 directory
you have already /users exported
1- go to /etc/auto.master and add
/users /etc/auto.users
2- go to the /etc/auto.users
* -rw server2:/users/&
systemctl autofs restart
,cd /users/user1 ---> to check if it is working or not
------------------------------------------------------
change the letter in vi from a file Correct Ans-Type :%s/ox/OX/g.
how to remove user from group Correct Ans-gpasswd -d username groupname
Vim
1- how to set the line numbers
2- how to copy paste the line Correct Ans-:set num
go to the line and yy and go to the new line and do p
find command: find path search option action
1- search a file
2- search the files names started with *usb
3-find files smaller than 1MB in size in the root user's home directory
4-find the files larger than +40M
5-find the file in root with the ownership set to user and owning group set to any group other
than
6- to search for directories by the ame src n /usr at a maximum of two subdirectory
7- find the file in the /etc directory that were modified -mtime more than the +sign 2000 dats
ago
, 8- find files in the /var/log directoru that have been modified (-mmin int eh past
100min Correct Ans-1- find . -name file01 -print
2-fine /dev -name *usb
3- find ~ -size -1M
4- find / -size +40M
5- find / daemon -not -group user1
6- find /usr -maxdepth 2 -type d -name src
7- find /etc -mtime +2000
8-find files in the /var/log -mmin -100
how to delete the ACL enteries set Correct Ans-setfacl -x u:user200 acliuser1
setfacl -b acluser1 ----> deletes the ACLs
1- view hisotry of failed user login attempt
2-report recent user login attmepts Correct Ans-1-lastb
2-lastlog
how to modify the prompt Correct Ans-export PS1="< $LOGNAME on $ (hostname) in \
$PWD"
how to control the user access for at and corn Correct Ans-at.allow
/at.denay/cron.allow/cron.deny just enter the username here per line.