Linux1 Flashcards
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?
The contents of the plab2.txt file will be
1
2
3 plab1.txt
Identify the correct statement(s) for a repository. [Choose all that apply]
The repository configuration files are stored in the /etc/yum.repos.d/ directory
The configuration file for a repository has the extension .repo
When you run the following command: cat /proc/mounts, where does it retrieve the information from?
kernel
You need to configure link bonding to support fault tolerance. Which of the following will meet your requirement? [Choose all that apply]
3 (broadcast) Broadcast policy
1 (active-backup) Active-backup policy
0 (balance-rr) Round-robin policy
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?
Brute-force attack
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]
Use the hwinfo command
View the /proc/partitions file
Use the fdisk -l command
Use the lsblk command
When you use the dd command with the obs parameter, what is the default number of bytes written at a time?
512
You need to display information about the currently loaded modules in your Linux system. Which of the following command should you use?
lsmod
Which of the following type of program is dependent on the external shared libraries?
Dynamically linked
Which type of Access Control Entry (ACE) should you use to log access attempts?
System-audit
Which of the following can be used to log events generated by ACLs?
SELinux
Which of the following does PKI offer through digital signature?
Non-repudiation
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?
/etc/network/interfaces
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
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?
Use the -r parameter
Which of the following directory contains the GPT specified UUIDs and labels?
by-partlabel
Which of the following file controls the start of a service?
/etc/inittab
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]
Restart the processes
Restart the system
You need to find out the currently logged in users and their processes. Which command should you use?
w
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?
!
Which of the following command is used to create the SSH key?
ssh-keygen
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?
Agent-based, out-of-band
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?
cat > plab1.txt «_space;EOF Hello PLAB Users EOF
Which of the files should you use to view the hard drive details?
/proc/partitions
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.]
Assign the group ownership to the parent directory
Use the chmod command to set the setgid
If you need to defragment an XFS filesystem, which of the following command should you use?
xfs_fsr
Which file should you edit to modify the user-specific configuration?
.bash_profile
If you are running a system in the multi-user environment with the network environment, which sysvinit run level are you in?
3
Which of the following separates the real file system from the operating system and system services?
VFS
Which of the following action is performed when you perform Ctrl + z on a running process?
The process is sent to the background
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?
Run the lsdev command with the -C parameter
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?
chef
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]
Disable USB in the BIOS
Disable USB hub through the operating system
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
ucredit=-1
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?
Run the mkswap command with the root privileges
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?
-D
Which of the following is responsible for updating the /etc/mtab file?
Mount command
You have several udev rules in the /etc/udev/rules.d/ directory. You want to govern the udev daemon. What should you do?
Run the udevadm control command
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]
Review the /usr/share/hwdata/pci.ids file
Use the lspci | grep “Fibre Channel” command
Which of the following command will enable the httpd service at a system startup?
chkconfig httpd on
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?
route
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?
Use the lsof command
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?
The ulimit command is a built-in command
Which of the following type of rules are supported by iptables? [Choose all that apply]
DNAT(Destination Network Address Translation)
SNAT(Source Network Address Translation)
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
Reject
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?
Disable
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:
- Install and configure DNSMASQ Server
- Install SYSLINUX Bootloaders
- Setup PXE Server Configuration File
- Create CentOS 7 Local Mirror Installation Source
- Start and Enable Daemons System-Wide
- Open Firewall and Test FTP Installation Source
1, 2, 3, 4, 5, 6,
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]
Perform continuous monitoring
Create a baseline for network assets
You need to clear the ring buffer message log. What should you do?
Run the dmesg command with the -c parameter
You need to open DTLS port in your edge firewall. Which port should you open?
443
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?
Use the objdump command
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
Which of the following happens to a service when it is masked?
The service cannot be started
Which of the following file is known as the private key for SSH2? [Choose all that apply]
id_rsa
id_dsa
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?
Edit the /etc/issue.net file
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?
The quotes are considered as 0
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]
Install and then run efibootmgr
Verify if the /sys/firmware/efi directory exists
You need to locate the modprobe.conf file. In which directory should you find it?
/etc
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]
Enable Heuristic analysis
Enable Flow logs
On your Linux system, you need to accomplish the following goals:
- Change the Full SELinux Context
- Change Context Using Another File as a Reference
- Change Only the User in SELinux Context
- Change Only the Role in SELinux Context
- Change Only the Type in SELinux Context
- 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?
1, 2, 3, 4, 5, 6
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?
Nslookup
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?
The policycoreutils package is not installed
Which of the following protocols are supported by the curl command? [Choose all that apply]
POP3
FILE
HTTP
SFTP
IMAP
The httpd service is running currently. You issue the following command:
systemctl disable application.service
What will be the outcome of this command?
The service will not start automatically at the system boot
Which of the following can be considered as an overlay network? [Choose all that apply]
Voice Over IP (VoIP)
Peer-to-peer (P2P)
Virtual Private Network (VPN)
Content Delivery Network (CDN)
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]
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
If you right-clicked on a host in the vCenter Server and created an OVF file, what should be its deployment location after creation?
At the host level
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?
Major and minor numbers
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?
Execute the sort < plab.txt > final.txt
If you want to make changes to any unit file, in which directory should you make the change?
/etc/systemd/system
If you execute the following command:
chkconfig httpd –list
What will be the output?
Service information with runlevel status is displayed
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?
> >
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?
You would be prompted with the permission denied error
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?
Add the yum-skip-brokenm plugin on your system
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?
The subdirectory will have the Default ACL, but the file will access ACL
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
Which of the following is likely to be used in arithmetic expressions where you are adding two numbers?
()
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?
Use the -a parameter with the ls command
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]
Reduce memory for the process
Add more physical memory in the system
Disallow the process to overcommit memory
You want to block SMTP traffic using access control lists. Which of the following port should you block?
25
To prevent file globbing, which of the following special characters can be used? [Choose all that apply]
backward slash ()
double quote (“)
the single quote (‘)
You have terminated a running process. Its process state has changed to Stopped. What will happen to the Stopped process? [Choose all that apply]
The Stopped process will release all system resources
The Stopped process will send signals about termination to the parent process
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
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]
Reboot the server
Find and delete files that are not required
If you need to edit the ssh.conf file, in which directory would you find it in?
/etc/init
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?
Use Wireshark to capture packet
Which of the following compression algorithm is used by xz?
LZMA2
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?
Memory usage is only 235M, which is minimal usage
Which of the following looping construct is mainly used for making a single decision?
if