Linux2 Flashcards
(90 cards)
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