Linux2 Flashcards

(90 cards)

1
Q

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?

A

Add the user to the wheel group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

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]

A

The root user owns the plab file

No one other than the root user can read, write and execute the file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

To create a user quota, which command should you execute?

A

userquota

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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?

A

touch -c plab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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?

A

COM1 & COM2 are being used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which value should you provide with the following command to disable a service at the system startup?:
chkconfig httpd _______

A

off

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

You need to reload a service without restarting it. Which of the following command should you use?

A

service reload

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

With which of the filesystems can you use the resize2fs command? [Choose all that apply]

A

ext2
ext3
ext4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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?

A

Processor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

You want to prevent the root user from directly logging on to the console. Which of the following file should you edit?

A

/etc/securetty

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

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?

A

Block

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Using the dumpe2fs command, you want to view the superblock information. Which of the following parameter should you use?

A

-h

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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?

A

Configure chroot jail for the user to write to the home directory only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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?

A

-lshw short

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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?

A

Use the cat file1 file2 files3 > PLAB command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

You need to troubleshoot a custom-built kernel. Which file should you refer to review the logged in information?

A

/var/log/kern.log

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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

A

1, 2, 3, 4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

When configuring LDAP and PAM integration, which module should be used?

A

pam_ldap

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

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]

A

The execute permission is not set on the directory

The permissions are only assigned to the username

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

While configuring user lockouts with PAM, what will happen if the /lib/security/pam_tally2?so file does not exist on your system?

A

It will lock out all the user accounts including root even if their passwords are correct

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

You create a file named plab.conf in the /etc directory. You want to view its security-context information. What should you do?

A

Use the ls -Z command with the file name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Which of the following is an example of an absolute path?

A

cd /foo/bar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Which of the following command should you use to find information about a module that does not have a file name?

A

modinfo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
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 ```
26
Identify the output of the following command: | lvcreate -L 100M -m1 -n mirrorlv plabvg
Creates 1 LV that will maintain one copy of data
27
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
28
Which module locks the user accounts after multiple failed authentication attempts?
pam_faillock
29
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
30
Which is the first report generated by the iostat command?
CPU Utilization
31
If you execute the following command: chkconfig httpd –list What will be the output?
Service information with runlevel status is displayed
32
You want to configure the total size of the archived logs. Which file should you edit for the same purpose?
journald.conf
33
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 ```
34
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
35
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
36
Which file should you edit to modify the user-specific configuration?
.bash_profile
37
After creating the local directories for a repository, which command should you run to synchronize it with the online repository?
reposync
38
Identify the Linux installation scenarios that can make the use of the fsck command. [Choose all that apply]
Files stored on the system are getting corrupted The system fails to boot due to the filesystem error A USB drive is not working properly
39
If you have a shell script that contains environmental variables, in which directory should you place the shell script?
/et/profile.d/
40
You are planning to use Infrastructure as a code. You have been asked to use the best practices. Which of the following best practices should you plan to use? 1. Code everything 2. Document as much as possible 3. Implement version control 4. Test, integrate, and deploy changes 5. Use modular infrastructure code
1,3,4,5
41
When you use the dd command with the obs parameter, what is the default number of bytes written at a time?
512
42
On an Ubuntu system, you have an Nvidia display adapter. You want to update the display adapter to the latest version. Identify the correct order of the tasks that you must perform: Determine the existing version of Nvidia display adapter Remove the existing display drivers Add the graphic adapter’s Personal Package Archives (PPAs) Install the latest display drivers Reboot the server
1,2,3,4,5
43
You have created a rule using the following command: auditctl -w /etc/shadow -p wa -k shadow After a while, you had to restart the system. When you execute the command: auditctl -l You notice that the rule is no longer there. What could be the possible cause?
It was a temporary rule that was deleted with the system reboot
44
On a Linux system, you have the following rule: sudo iptables -I INPUT 7 -p tcp --dport 81 -m state --state NEW -j ACCEPT You run the following command: sudo iptables -D INPUT 7 What do you intend to do?
Delete rule number 7
45
Which of the following daemon is used for monitoring the MD multipath devices?
mdmpd
46
Which of the following type of program is dependent on the external shared libraries?
Dynamically-Linked
47
You want to configure the sendmail service to accept messages from the cron. Sendmail should be configured to accept cron job reports. However, it should also be configured not to accept any messages from the network. What should you do?
Configure it to listen to the local loopback address
48
Which of the directory contains the init shell scripts?
/etc/init.d
49
You are setting up a network and need to ensure that it performs at an optimum speed. You want to ensure that there are no latency issues in the network. Moreover, you need to ensure the optimal level of security. To achieve this, you consider the following tasks: 1. Minimize the number of rules on the router 2. Configure auditing only for the necessary events 3. Add a greater number of security controls 4. Disable authentication within the network 5. Which of these tasks are required to meet your goal?
1 and 2
50
You execute the following command: ssh -v -R 2255:localhost:2255 admin@plab.com However, SSH remote port forwarding does not work. What could be the possible cause?
The GatewayPorts yes parameter is not enabled on the server.
51
You have a CentOS system. You want to display the system’s virtual memory statistics. You also want to display memory, paging, and disk activities. Which of the following command should help you achieve this?
Use the vmstat command
52
You need to check the services that are set to automatic start on a CentOS system. Which command should you use for this purpose?
Chkconfig
53
You have a single server, and you need to deploy multiple operating systems. Each operating system will be running a different application, and you need to ensure all of them are running at once. What should you do?
Install a hypervisor and install one operating system per virtual machine
54
You have a dual-boot system with Windows 10 and Ubuntu system. You want to verify if your system is running UEFI. Which of the two methods can help you verify this? [Choose all that apply]
C. Verify if the /sys/firmware/efi directory exists D. Install and then run efibootmgr
55
If you do not provide a DNS server name with the dig command, which of the following file will it reference?
/etc/resolv.conf
56
You have an Ubuntu 14.04 installation on a system. You want to edit the default theme as well as change the background image. Which of the following activities can help you achieve this?
Edit the/etc/default/grub file
57
In the /etc/passwd file, which field defines the number of days after which the user account should be disabled after its password has expired ?
Inactive
58
In which of the following language is the GNU Compiler Collection written?
C
59
You want to perform passive reconnaissance in your organization and test out the security controls. In addition, you want to perform a passive DNS assessment and want to know the details of the organization’s DNS servers. Which of the following method would help you achieve your goal?
Execute the WHOIS query
60
You create a profile that you want to test out for violations. You want the access violations to be logged in the system log, but the actions should be permitted. What should you do?
Put the profile in the complain mode
61
You have an application in GitHub. You get the following E-mail: Subject: Page build failed The page build failed with the following error: There was a YAML syntax error on line `line_number` column `column_number` in `filename`: `syntax_error`. Which of the following can help identify the possible causes of the errors ? [Choose all that apply]
``` A. Check for space between the key value and colon before the value B. Check for the tab characters in the file C. Check for the indentations D. Verify multi-line entries’ values ```
62
You have been asked to make architectural changes in the existing network and meet the following goals: 1. The origin of the Web server should not be known to the clients 2. All Web servers must use a single public IP address 3. Reduce load on its origin servers by caching static content 4. Distribute the load from incoming requests to several servers As the architectural change, you decide to implement a reverse proxy. If you do this, which of the above-mentioned goals will be met?
1,2,3,4
63
You want to use the Noop I/O scheduler on a Red Hat Enterprise Linux (RHEL) 7 system. You want to set Noop for all devices, which are SSD-based devices. You want to ensure that by configuring Noop, you can reduce I/O latency and increase throughput. What should you do?
Set the elevator=noop parameter in the /etc/grub.conf file
64
You issue the lpr command to print a file. You know that the command is successful and print request has been sent to the printer. However, the printer does not print the file. You verify that the printer is on and connected to the network. You also verify that the printer has papers. What else should you do to resolve this issue? [Choose all that apply]
``` A. Use the lpstat command to check your jobID B. Wait for the document to print C. Restart the printer D. Use the lpq command to check your jobID ```
65
You execute the following command: (echo to stdout ; echo to tty > /dev/tty ) > plabfile Which of the following is true about the output of this command?
The output of to stdout will be redirected to the file and to tty output on the screen
66
The security administrator has discovered several vulnerabilities in an off-the-shelf application but is not sure whether these vulnerabilities are known and published. What should the administrator do to find this out?
Verify with the CVE database
67
You want to perform real-time network bandwidth usage. However, you want to perform the network bandwidth utilization based on the IP addresses without performing name resolution. What should you do?
Use the -n parameter with the iftop command
68
You have a Linux system on which you want to sync time with one of the internal NTP servers. You need to ensure that the time of the Linux system is properly synced with the NTP server. What should you do? [Choose all that apply]
``` A. Stop the ntpd daemon B. Install the ntpdate command C. Run the ntpdate command ```
69
You had created an environment variable named plab in the Bash shell. You do not require this variable any longer and want to remove it. What should you do?
Run the export -n variable command
70
Identify steps that can help you resolve a kernel panic. Identify the boot process stage during which the kernel panic occurred. 1.Verify if you can boot from an old kernel. 2.Try creating the initramfs file manually 3.Locate if there are missing initramfs file 4.Try to free inodes in the /tmp directory
1, 2, 3, 4, 5
71
Identify the correct statement(s) for a repository. [Choose all that apply]
The configuration file for a repository has the extension .repo The repository configuration files are stored in the /etc/yum.repos.d/ directory
72
You have a lot of files that contain the words plab and PLAB in your current directory. You want to perform a search for these words but do not want to perform a case-sensitive search using the grep command. What should you do?
grep -i plab .
73
Which of the following methods are valid for running a shell script named plab.sh? [Choose all that apply]
./plab.sh Bash plab.sh
74
You want to block SMTP traffic using access control lists. Which of the following port should you block?
25
75
You have recently implemented application streaming on a Linux system on your network. You have made the following configuration: Enforced encryption Configured the session timeout Configured access control on the application streaming server With this configuration, you should be able to prevent which of the following attack?
Prevent the eavesdropping attack
76
You want to block traffic from the specific IP address using ipset. To do this, you perform the following steps: Install ipset on the CentOS system Create a blacklist with hash:ip Add rules in the blacklist After doing these tasks, what else should you do as the next step to ensure the blocking works in the desired manner?
Test the ipset rules
77
Which of the following happens to a service when it is masked?
The service cannot be started
78
You have several udev rules in the /etc/udev/rules.d/ directory. You have made significant changes to one rule from this directory. What should you do next without much administrative effort?
Reload the rules
79
You are configuring SNMP v3 on a CentOS 7 system. You have performed the basic configuration and now need to permit the port for SNMPv3 through iptables. Which port should you allow through iptables?
161
80
Which of the following file is referenced before a system references a DNS server on the network?
/etc/hosts
81
When you need to use tar with gzip to compress a file, you need to use the _____ and ______ parameters.
- z | - c
82
Which of the following are provided by hashing? [Choose all that apply]
Non-repudiation Integrity
83
Which of the following tool does not work with the deb packages but works with deb archive?
apt
84
To view the filesystem parameters, which of the following parameters should you use with the tune2fs command?
-l
85
Which of the following command will rebuild the LVM cache file by scanning the disks for volume groups?
vgscan
86
You need to print the name and value of each shell variable available. Which of the following command will help you achieve this?
set
87
Identify the output of the following command: | git commit -m “[message]”
Identify the output of the following command: | git commit -m “[message]”
88
Where is the user-level global configuration stored on a Windows system?
C:\Users\\.gitconfig
89
Identify the output of the following command: | git push
It will push the local repository changes to the remote repository
90
What is the descriptor value assigned to stdin?
0