Linux1 Flashcards

1
Q

You execute the following command:

wc -l plab1.txt|tee -a plab2.txt

The contents of the plab1.txt are:
1
2
3

With the given command, what would be the contents of the plab2.txt file?

A

The contents of the plab2.txt file will be
1
2
3 plab1.txt

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

Identify the correct statement(s) for a repository. [Choose all that apply]

A

The repository configuration files are stored in the /etc/yum.repos.d/ directory

The configuration file for a repository has the extension .repo

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

When you run the following command: cat /proc/mounts, where does it retrieve the information from?

A

kernel

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

You need to configure link bonding to support fault tolerance. Which of the following will meet your requirement? [Choose all that apply]

A

3 (broadcast) Broadcast policy

1 (active-backup) Active-backup policy

0 (balance-rr) Round-robin policy

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

You enable your Linux Web server with the PKI-based login. When you connect to this Web server, you are not prompted for the password. With this configuration, which of the security risks are you avoiding?

A

Brute-force attack

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

You want to list out all the storage devices that are connected to a Linux system. You want to ensure that both mounted and unmounted devices are listed. What should you do? [Choose all that apply]

A

Use the hwinfo command

View the /proc/partitions file

Use the fdisk -l command

Use the lsblk command

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

When you use the dd command with the obs parameter, what is the default number of bytes written at a time?

A

512

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

You need to display information about the currently loaded modules in your Linux system. Which of the following command should you use?

A

lsmod

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

Which of the following type of program is dependent on the external shared libraries?

A

Dynamically linked

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

Which type of Access Control Entry (ACE) should you use to log access attempts?

A

System-audit

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

Which of the following can be used to log events generated by ACLs?

A

SELinux

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

Which of the following does PKI offer through digital signature?

A

Non-repudiation

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

You need to configure the nameservers for a static IP address on your system. Which of the following would be the correct file to edit?

A

/etc/network/interfaces

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

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?

A

Update the device drivers

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

You are attempting to copy the contents of one directory, PLAB, to another directory, PIL. You execute the following command:

cp PLAB PIL

You are prompted with an error that this is a directory.
You need to copy all files from the PLAB directory to the PIL directory without any error. What should you do?

A

Use the -r parameter

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

Which of the following directory contains the GPT specified UUIDs and labels?

A

by-partlabel

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

Which of the following file controls the start of a service?

A

/etc/inittab

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

You are using Ubuntu on your system. You run the aa-status command and find out that processes are running in the unconfined state. You verify and conclude that these processes have a profile defined. What should you do to resolve this issue? [Choose all that apply]

A

Restart the processes

Restart the system

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

You need to find out the currently logged in users and their processes. Which command should you use?

A

w

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

You need to create a shell script. Which of the following is the directive that must be added in the first line of the shell script?

A

!

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

Which of the following command is used to create the SSH key?

A

ssh-keygen

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

When you connect to your network, either through a physical wire or remotely, the network access control application validates the state of your system. Your system has a small application installed that communicates with the network access control application. Which of the following solution has the security administrator implemented?

A

Agent-based, out-of-band

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

You have a plab.txt file that contains the following content:
Hello
PLAB
Users

You want to generate another file plab1.txt and add the same content using a single command. Which of the following command will help you achieve this?

A

cat > plab1.txt &laquo_space;EOF Hello PLAB Users EOF

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

Which of the files should you use to view the hard drive details?

A

/proc/partitions

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

You have created a directory on a Linux system. You want all the files that are created within this directory should inherit the parent directory’s permissions only. What should you do? [Choose all that apply.]

A

Assign the group ownership to the parent directory

Use the chmod command to set the setgid

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

If you need to defragment an XFS filesystem, which of the following command should you use?

A

xfs_fsr

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

Which file should you edit to modify the user-specific configuration?

A

.bash_profile

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

If you are running a system in the multi-user environment with the network environment, which sysvinit run level are you in?

A

3

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

Which of the following separates the real file system from the operating system and system services?

A

VFS

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

Which of the following action is performed when you perform Ctrl + z on a running process?

A

The process is sent to the background

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

You are using a Linux system. You need to display the information for a device that is in the Customized Devices object class. What should you do?

A

Run the lsdev command with the -C parameter

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

You need to deploy a series of Linux virtual machines (VMs) in Microsoft Azure. You need to use an application lifecycle automation tool. With the given choices, which of the following would be most appropriate?

A

chef

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

You have a kiosk that has USB enabled and is isolated from the network. Recently, a user copied an infected file into the kiosk. You want to ensure no one can use USB on the kiosk.
Which of the following individual actions can possibly help achieve this? [Choose all that apply]

A

Disable USB in the BIOS

Disable USB hub through the operating system

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

On a Debian system, you are editing the /etc/pam.d/common-password file. Which keyword and value should you add at the end of the following line if you need to ensure that the user must use one uppercase letter in the password:

password requisite pam_pwquality.so retry=3

A

ucredit=-1

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

You run the mkswap command:

mkswap /dev/hda1

but are prompted with the following error:

mkswap: command not found

How should you resolve this error?

A

Run the mkswap command with the root privileges

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

You want to use the dmesg command to clear the ring buffer. However, you do not want the messages to be printed on the screen. Which parameter should you use with the dmesg command?

A

-D

37
Q

Which of the following is responsible for updating the /etc/mtab file?

A

Mount command

38
Q

You have several udev rules in the /etc/udev/rules.d/ directory. You want to govern the udev daemon. What should you do?

A

Run the udevadm control command

39
Q

You want to obtain the vendor and device IDs for the installed HBAs in a Linux system. What should you do? [Choose all that apply]

A

Review the /usr/share/hwdata/pci.ids file

Use the lspci | grep “Fibre Channel” command

40
Q

Which of the following command will enable the httpd service at a system startup?

A

chkconfig httpd on

41
Q

You are viewing the following output of a command:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
192.168.50.0 * 255.255.255.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 192.168.50.1 0.0.0.0 UG 0 0

Use Iface
0 eth0

Which of the following command have you executed?

A

route

42
Q

You are working on a CentOS system that has various partitions with ext4 filesystem. You need to unmount a filesystem but are prompted with an error that the filesystem cannot be unmounted as files are being used. You need to identify these files. What should you do?

A

Use the lsof command

43
Q

On your Ubuntu system, you run the following command:

ulimit -n

You get the answer as 1024. You want to raise the limit to 5000. When you execute the following command, you are prompted with an error:

sudo ulimit -in 5000

You get the following error:

sudo: ulimit: command not found

What could be the possible reason?

A

The ulimit command is a built-in command

44
Q

Which of the following type of rules are supported by iptables? [Choose all that apply]

A

DNAT(Destination Network Address Translation)

SNAT(Source Network Address Translation)

45
Q

If you need to send the ICMP destination unreachable message to the source host that had sent the packet, which of the following should provide the desired result

A

Reject

46
Q

You manage multiple Ubuntu systems that use Personal Package Archives (PPAs) for package installation. You do not want these packages to receive updates. You have been advised to use the sudo apt-get install command with the appropriate option. Which of the following option should help you meet the required goal?

A

Disable

47
Q

You need to install the CentOS Linux on multiple systems. You decide to use the PXE method for installation. From the given list, identify the steps that you must perform:

  1. Install and configure DNSMASQ Server
  2. Install SYSLINUX Bootloaders
  3. Setup PXE Server Configuration File
  4. Create CentOS 7 Local Mirror Installation Source
  5. Start and Enable Daemons System-Wide
  6. Open Firewall and Test FTP Installation Source
A

1, 2, 3, 4, 5, 6,

48
Q

You have a network of 100 systems and 10 servers. You want to be able to detect a rogue system or device if it is present on the network. Which two steps must you perform to achieve this goal? [Choose all that apply]

A

Perform continuous monitoring

Create a baseline for network assets

49
Q

You need to clear the ring buffer message log. What should you do?

A

Run the dmesg command with the -c parameter

50
Q

You need to open DTLS port in your edge firewall. Which port should you open?

A

443

51
Q

On a Linux system, you have third-party applications running. You want to view the library dependencies of an application binary that you had downloaded from untrusted sources for testing. What should you do?

A

Use the objdump command

52
Q

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?

A

Install a hypervisor and install one operating system per virtual machine

53
Q

Which of the following happens to a service when it is masked?

A

The service cannot be started

54
Q

Which of the following file is known as the private key for SSH2? [Choose all that apply]

A

id_rsa

id_dsa

55
Q

You want to display a banner before a user is prompted for a password when using an SSH connection. The banner must be displayed before the password prompt but after the login as prompt. What should you do?

A

Edit the /etc/issue.net file

56
Q

On a CentOS system, you run the following command to find the child processes of a process:

pgrep -P httpd

You get the list of the child process. Then, you run the following command:

pgrep -P “ “

The response is returned as 1, 2.

What is the probable reason?

A

The quotes are considered as 0

57
Q

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]

A

Install and then run efibootmgr

Verify if the /sys/firmware/efi directory exists

58
Q

You need to locate the modprobe.conf file. In which directory should you find it?

A

/etc

59
Q

After reviewing the recent logs on a server, the security administrator notices that the server recently transferred a large amount of data to an unknown public IP address. What should the administrator do to detect such events? [Choose all that apply]

A

Enable Heuristic analysis

Enable Flow logs

60
Q

On your Linux system, you need to accomplish the following goals:

  1. Change the Full SELinux Context
  2. Change Context Using Another File as a Reference
  3. Change Only the User in SELinux Context
  4. Change Only the Role in SELinux Context
  5. Change Only the Type in SELinux Context
  6. Change Only the Range (Level) in SELinux Context

You decide to use the chcon command. If you use this command, which of the following can be achieved?

A

1, 2, 3, 4, 5, 6

61
Q

You have executed a command to query the DNS server for the domain, www.google.com. When you run this command, you get the following information:
Non-authoritative answer:
Name: www.google.com
Address: 172.217.166.36

Which command would have you executed to get this output?

A

Nslookup

62
Q

You have modified an iptables rule. You run the following command:

service iptables save

When you run this command, you are prompted with the following error:

iptables: Saving firewall rules to /etc/sysconfig/iptables: /etc/init.d/iptables: line 274: restorecon: command not found.

What could be the possible cause?

A

The policycoreutils package is not installed

63
Q

Which of the following protocols are supported by the curl command? [Choose all that apply]

A

POP3

FILE

HTTP

SFTP

IMAP

64
Q

The httpd service is running currently. You issue the following command:

systemctl disable application.service

What will be the outcome of this command?

A

The service will not start automatically at the system boot

65
Q

Which of the following can be considered as an overlay network? [Choose all that apply]

A

Voice Over IP (VoIP)

Peer-to-peer (P2P)

Virtual Private Network (VPN)

Content Delivery Network (CDN)

66
Q

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

Restart the printer

Use the lpq command to check your jobID

Wait for the document to print

67
Q

If you right-clicked on a host in the vCenter Server and created an OVF file, what should be its deployment location after creation?

A

At the host level

68
Q

You execute the following command:

Ls -l /dev

You get the following output:

crw-rw-rw- 1 root root 1, 3 Apr 19 2019 null
crw——- 1 root root 10, 1 Apr 19 2019 psaux
crw–w—- 1 vcsa tty 7, 1 Apr 11 2019 vcs1
crw–w—- 1 vcsa tty 7, 129 Apr 11 2019 vcsa1
crw-rw-rw- 1 root root 1, 5 Apr 11 2019 zero

What does the value 1, 3 represent in the 5th and 6th column?

A

Major and minor numbers

69
Q

You have a file named plab.txt. You want to read its contents and redirect the output of this file to another file named final.txt in a sorted manner. How should you achieve this goal with a single command?

A

Execute the sort < plab.txt > final.txt

70
Q

If you want to make changes to any unit file, in which directory should you make the change?

A

/etc/systemd/system

71
Q

If you execute the following command:
chkconfig httpd –list
What will be the output?

A

Service information with runlevel status is displayed

72
Q

You have a file named plab. You need to append some data to this file. Which of the following operator will you need to use?

A

> >

73
Q

You have a directory named PLAB, which is write protected. You want to delete a sub-directory name PIL, which is not write-protected. You execute the following command:
rm -f /PLAB/PIL
What would be the outcome of this command?

A

You would be prompted with the permission denied error

74
Q

You add a repository name in your CentOS 5 system. After adding the repository, you attempt to upgrade a package and are prompted with the missing dependency errors. You want to avoid the missing dependency errors and upgrade a few packages. What should you do?

A

Add the yum-skip-brokenm plugin on your system

75
Q

You have a directory named plab on which you have applied the Default ACL. You create a subdirectory within the plab directory, and then you create a file. What will be the outcome of these actions?

A

The subdirectory will have the Default ACL, but the file will access ACL

76
Q

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?

A

Verify with the CVE database

77
Q

Which of the following is likely to be used in arithmetic expressions where you are adding two numbers?

A

()

78
Q

You execute the ls command to list the files in the current directory. However, you notice that you are not able to view the hidden files. You want to list the hidden files using the ls command. What should you do?

A

Use the -a parameter with the ls command

79
Q

Your CentOS system has Apache Web server running. The process for Apache Web server is being stopped abruptly. When you check the /var/log file, there are entries that confirm that Out-of-memory (OOM) has killed the Apache process. Which of the following options can help you resolve this issue? [Choose all that apply]

A

Reduce memory for the process

Add more physical memory in the system

Disallow the process to overcommit memory

80
Q

You want to block SMTP traffic using access control lists. Which of the following port should you block?

A

25

81
Q

To prevent file globbing, which of the following special characters can be used? [Choose all that apply]

A

backward slash ()

double quote (“)

the single quote (‘)

82
Q

You have terminated a running process. Its process state has changed to Stopped. What will happen to the Stopped process? [Choose all that apply]

A

The Stopped process will release all system resources

The Stopped process will send signals about termination to the parent process

83
Q

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?

A

Prevent the eavesdropping attack

84
Q

You are unable to create files on a Linux system. When you execute the df -I command, you notice that the inodes usage is 100%. You also notice that the disk is only 50% full. What should you do to free up the inodes? [Choose all that apply]

A

Reboot the server

Find and delete files that are not required

85
Q

If you need to edit the ssh.conf file, in which directory would you find it in?

A

/etc/init

86
Q

The network administrator has implemented a virtual machine in an MPLS cloud that is owned by the organization. A domain user attempts to connect to the virtual machine but is not able to connect. The user is not able to access the application hosted on the virtual machine.
The network administrator uses a laptop, which is not part of the domain, connects to the network, and is able to connect to the virtual machine.

The network administrator checks the user’s system, which is part of the domain, and finds that the user’s system is configured with the proxy configuration and uses a PAC file.

What should the network administrator do next to determine the cause of this issue?

A

Use Wireshark to capture packet

87
Q

Which of the following compression algorithm is used by xz?

A

LZMA2

88
Q

You run the following command to print the memory statistics:
free -h
You get the following output:

        total   used    free  shared  buffers cached Mem: 993M 738M 255M  5.7M    64M     439M -/+ buffers/cache: 234M    759M Swap:              0B      0B      0B

What do you interpret from this output?

A

Memory usage is only 235M, which is minimal usage

89
Q

Which of the following looping construct is mainly used for making a single decision?

A

if