Linux2 Flashcards
You need to assign a user the administrative capabilities on a Linux system. You want to allow the user to perform any task without using the su command. What should you do?
Add the user to the wheel group
To view the permissions of a file named plab, you run the following command:
ls -l plab
Following is the output displayed:
-rwxr-xr-x 1 root root 316848 Mar 27 2019 plab
Based on the output, which of the following permissions are correct? [Choose all that apply]
The root user owns the plab file
No one other than the root user can read, write and execute the file
To create a user quota, which command should you execute?
userquota
You want to create a file named plab. However, you want that this file should not be created if another file with the same name already exists. Which of the following command should help you achieve this goal?
touch -c plab
You run the following command on a Linux system:
dmesg | grep tty
You get the following output:
[ 37.531286] serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 37.531841] 00:0b: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
[ 37.532138] 0000:04:00.3: ttyS1 at I/O 0x1020 (irq = 18) is a 16550A
Based on the output, determine which ports are being used?
COM1 & COM2 are being used
Which value should you provide with the following command to disable a service at the system startup?:
chkconfig httpd _______
off
You need to reload a service without restarting it. Which of the following command should you use?
service reload
With which of the filesystems can you use the resize2fs command? [Choose all that apply]
ext2
ext3
ext4
You have been asked to manage a Linux system. You need to find out its hardware details. To do this, you execute the following command:
dmidecode -t 4 | head
Which of the following information are you likely to receive?
Processor
You want to prevent the root user from directly logging on to the console. Which of the following file should you edit?
/etc/securetty
You want to use a blob on Microsoft Azure to store text files. You will be using the blob for thousands of text files. Which of the following blob will meet your requirement in this situation?
Block
You are developing an application that will use OAuth. You want to ensure that you are able to implement OAuth2.0 in the application securely. Which of the following methods would help you achieve this? [Choose all that apply]
A.
Configure a lifetime for the access tokens
B.
Store the hashed value of client secrets in the database
C.
Always verify the SSL certificate
D.
Use short-lived tokens and always refresh them
E.
Always make use of the SSL
Using the dumpe2fs command, you want to view the superblock information. Which of the following parameter should you use?
-h
You need to allow a user to remotely log in using SSH but want to restrict the user’s access only to the home directory. Other users should be allowed to access and write to their home directories as well as the other directories on the server. What should you do?
Configure chroot jail for the user to write to the home directory only
You manage a Linux system. You have been asked to generate the device tree in the system. You also want to list the hardware path for each device. You decide to use the lshw command. Which of the following command will generate the desired output?
-lshw short
You have multiple files on your Linux system, and you want to redirect the contents of these files into a single file named PLAB. You must achieve this goal with minimum administrative effort. What should you do?
Use the cat file1 file2 files3 > PLAB command
You need to troubleshoot a custom-built kernel. Which file should you refer to review the logged in information?
/var/log/kern.log
You have a software RAID 1 array configured with two disks. While working on the RAID1, you notice that the status is marked as:
ARRAY is DEGRADED.
You have a spare disk of the same capacity. Identify the correct order of steps that you must perform to fix this issue.
Replace the old disk
Partition the new disk
Reattach the partitions to the RAID array
Make GRUB aware of the new disk
1, 2, 3, 4
When configuring LDAP and PAM integration, which module should be used?
pam_ldap
You execute following commands on a directory:
sudo mkdir /PLAB/PIL/London/
sudo chown -R username:username /PLAB/PIL/London/
sudo chmod -R 777 /PLAB/PIL/London/
When you execute the ls command to view the directory:
ls -al /PLAB/PIL/London/
ls: cannot access ‘/path/to/the/directory/’: Permission denied
What could be the possible cause of this problem? [Choose all that apply]
The execute permission is not set on the directory
The permissions are only assigned to the username
While configuring user lockouts with PAM, what will happen if the /lib/security/pam_tally2?so file does not exist on your system?
It will lock out all the user accounts including root even if their passwords are correct
You create a file named plab.conf in the /etc directory. You want to view its security-context information. What should you do?
Use the ls -Z command with the file name
Which of the following is an example of an absolute path?
cd /foo/bar
Which of the following command should you use to find information about a module that does not have a file name?
modinfo
Which of the following are necessary directories in a local repository on a CentOS system? [Choose all that apply]
A. centosplus B. updates C. base D. extras
Identify the output of the following command:
lvcreate -L 100M -m1 -n mirrorlv plabvg
Creates 1 LV that will maintain one copy of data
You have one QLogic HBA card in a system that runs Red Hat Enterprise Linux 5.3. When you boot the system, the HBA is not detected. You run the following command:
ll -d qla2xxx
However, the command does not display any output. How should you possibly resolve this issue?
update the device drivers
Which module locks the user accounts after multiple failed authentication attempts?
pam_faillock
You want to mount all file systems that are listed in the /etc/fstab file. Which parameter of the mount command will help you achieve this?
-a
Which is the first report generated by the iostat command?
CPU Utilization
If you execute the following command:
chkconfig httpd –list
What will be the output?
Service information with runlevel status is displayed
You want to configure the total size of the archived logs. Which file should you edit for the same purpose?
journald.conf
When you issue the systemctl status command, which of the following is displayed in the output? [Choose all that apply]
B. The cgroup hierarchy C. Service state D. A few lines of the log files
You have a user named Josh on your Linux system. You need to allow this user to edit a file that requires administrative privileges. You do not want the user to get extra privileges other than just editing the file. To meet this goal, which of the following statement should you add in the /etc/sudoers file?
%newsudo ALL = sudoedit /path/to/file
You create a new directory named plab. You want to ensure that you, as the owner, and the group is able to navigate into the directory and access files. You should be able to write to the files, but the group should be able to view the files. Others should not be able to enter the directory. What should you do?
Set the permission to 750
Which file should you edit to modify the user-specific configuration?
.bash_profile