Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CompTIA Linux+ XK0-004 Exam Prep correct Answers, Exams of Computer Science

A list of questions and correct answers related to the CompTIA Linux+ XK0-004 Exam. The questions cover topics such as BASH commands, Xorg configuration, network connections, USB drives, ISO images, file systems, job scheduling, and email configuration. The document also includes commands for network interface management, DNS configuration, and SSH tunneling. The document could be useful as study notes or exam preparation material for students taking the CompTIA Linux+ XK0-004 Exam.

Typology: Exams

2021/2022

Available from 10/25/2022

DrShirley
DrShirley 🇺🇸

3.7

(3)

1.6K documents

1 / 13

Toggle sidebar

Related documents


Partial preview of the text

Download CompTIA Linux+ XK0-004 Exam Prep correct Answers and more Exams Computer Science in PDF only on Docsity! CompTIA Linux+ XK0-004 Exam Prep correct Answers While using the BASH, which of the following commands will switch the default display in such a way that new applications will appear on the remote machine 192.168.1.50? A. display 192.168.1.50 B. export DISPLAY=192.168.1.50 C. export TARGET=192.168.1.50 D. switch 192.168.1.50 - ✔ B. export DISPLAY=192.168.1.50 Which of the following commands will display a user's current environment variables? (Select TWO) A. env B. info env C. displayenv D. man env E. printenv - ✔ A. env & E. printenv Which of the following is the default location of the Xorg configuration file? A. /etc/X11/xorg.conf B. /etc/X11/X.conf C. /etc/X/xorg.conf D. /etc/Xorg/X.conf - ✔ A. /etc/X11/xorg.conf Which of the following commands will explicitly start a full X windows system session? A. startx B. xinit C. X D. startX - ✔ A. startx After installing and enabling the latest accelerated video card driver, the system fails to start the X Window System on a reboot. Which of the following drivers is MOST likely to allow the system to start the GUI? A. vesa B. vega C. xorg D. krfb - ✔ A. vesa Which of the following commands will cause gedit to use workstation1 for I/O? A. DISPLAY=workstation1 gedit B. CONNECT=workstation1 gedit C. GRAPHICS=workstation1 gedit D. CONSOLE=workstation1 gedit - ✔ A. DISPLAY=workstation1 gedit Which of the following commands will show status information of the print queues? A. lpstatus B. showprint C. lpqueue D. lpstat - ✔ lpstat Where is the default location of sendmail binary? A. /usr/lib/sendmail B. /etc/mail/sendmail C. /var/spool/sendmail D. /sbin/sendmail - ✔ A. /usr/lib/sendmail Which of the following files holds information on the system's time zone? A. /etc/timezone B. /etc/localtime C. /etc/time D. /etc/localzone - ✔ B. /etc/localtime Which of the following commands will show active network connections? A. ipstat B. ifstat C. netstat D. networkstat - ✔ C. netstat A user has inserted a USB drive but it has not been automatically mounted. Which of the following commands will show the device name of the USB drive? A. mount -t usb B. fdisk -l C. usb_scan D. partprobe - ✔ B. fdisk -l Which of the following will burn an ISO image to a writable SCSI CD-ROM drive located on SCSI address 0,1,0? A. cdrecord -v -eject dev=0,1,0 data.iso B. cdrecord -t scsi -eject -d=0,1,0 data.iso C. cdrecord dev=0,1,0 -t=data.iso D. cdrecord -V -dev 0,1,0 -eject data.iso - ✔ A. cdrecord -v -eject dev=0,1,0 data.iso Which of the following /etc/fstab entries represents a Read-Write file system that can be mounted by any user? A. /dev/hdc1 /data ext3 noauto,users 0 0 B. /dev/hdc1 /data auto defaults 0 0 C. /dev/hdc1 /data auto noauto,user 0 0 D. /dev/hdc1 /data ext3 defaults 0 0 - ✔ A. /dev/hdc1/data ext3 noauto,users 0 0 How to disable and enable printers? - ✔ cupsdisable dummyprinter cupsenable dummyprinter command allows a user to administer his/her own group membership list without the requirement of superuser privileges. - ✔ groupmems How to find files that has SUI set. - ✔ $ find / -perm /4000 To scan the entire network using nmap - ✔ nmap 8.8.8.8/24 which file can you limit the number of processes for a user or group? - ✔ /etc/security/limits.conf which show you when is the last time a user has logged into or never logged into the system. - ✔ lastlog which old method to allow and deny hosts? - ✔ /etc/hosts.allow & /etc/hosts.deny $ ls -lZ - ✔ this will show if the file is handled under selinux How to search for SElinux related issues in the logs? - ✔ $ grep AVC | /var/log/audit/audit.log Which command you can use to schedule a job at a later time, just once? - ✔ at 9:30 PM Tue warning: commands will be executed using /bin/sh at> echo "Well gosh golly, it's 9:30 PM on Tuesday." at> ^D Which file you can use to schedule cron jobs? - ✔ /etc/crontab What is the format of the lines in /etc/crontab? - ✔ * * * * * user command min hour day mon dow files to allow users to user or not to use at or cron? - ✔ /etc/at.deny /etc/at.allow /etc/cron.deny /etc/cron.allow What can schedules job within a specific time frame? - ✔ /etc/anacrontab what is the most trusted stratum number? - ✔ ntp uses stratum (highest trusted in stratum 1). how to set date? - ✔ date -s 9:15 or timedatectl set-time 9:15 how to synchronize hardware and system clock? - ✔ $ hwclock --hctosys $ hwclock --systohc which file that you can check for zone information? - ✔ /usr/share/zoneinfo log files are typically stored where? - ✔ /var/log what service will allow you to take care of when logs are deleted and stuff like that ? - ✔ /etc/logrotate.conf where is the syslog confiigration file? - ✔ /etc/rsyslog.conf Not every service logs to syslog. - ✔ local1-7 is used for that service. Apache and Samba are among those servers. Apache: Errorlog syslog:local1 new logging system for systemd systems. - ✔ journald and works hand in hand with rsyslog journalctl bring a network interface up or down - ✔ ifconfig enps035 down assign an interface ip address or netmask - ✔ ifconfig enps035 192.168.1.100 ifconfig enps3045 netmask 255.255.0.0 most important file for network configuration - ✔ /etc/sysconfig/network-scripts On Debian systems: /etc/network/interfaces show interfaces status - ✔ ip link show or ip addr show static ip addressing or dhcp - ✔ BOOTPROTO = none or dhcp Configuring Client Side DNS - ✔ /etc/resolv.conf Received mail goes to - ✔ /var/spool/mail Create E-mail Aliases - ✔ /etc/aliases and exectue: $ newaliases so the changes take effect. important file to configure email - ✔ /etc/postfix/master.cf /etc/postfix/main.cf (queue directory where the messages will be stored). what to do for email forwarding - ✔ set relayhost ip address in /etc/postfix/main.cf configure ssh server - ✔ /etc/ssh/sshd_config important options for ssh configuration - ✔ PermitRootLogin yes PasswordAuthentication yes X11Forwarding yes UseDNS no how to do SSH Tunneling - ✔ ssh -L 9000:ismvml61:443 aabdalma@ismnagios AllowTcpForwarding yes If you want to secure email messages and file transfers, you should use: - ✔ GnuPG to generate keys: gpg --gen-key results will be in stored in: ~/.gnupg directory gpg.pub gpg --{sign|clearsign) originalfile For an increased of security, we use -sign --armor if you intend to the send the key over by email. . Which of the following commands launches Orca with speech capabilities? - ✔ orca -- no-setup --disable main-window Which of the following areas within an Ubuntu system contains information and settings for accessibility? - ✔ Universal Access Which command can be used to set the delay and repeat rate for a keyboard? - ✔ kbdrate Which of the following locations stores the configuration for LightDM? - ✔ /etc/lightdm or /usr/share/lightdm. Which variable is used to indicate the screen on which GUI applications will be shown? - ✔ DISPLAY Which of the following commands displays statistics and information about windows in X windows? - ✔ xwininfo Users can be added or removed for access to the X server. Which command facilitates this? - ✔ xhost Which option to useradd sets the number of days between password expiration and when the account is disabled? - ✔ The -f option sets the days between expiration and disabled for an account. The -g option is used to set the group ID, while -e is used to set the overall expiration date. Which of the following commands displays the current mail aliases known on the server? - ✔ getent aliases Which of the following configuration lines in /etc/hosts.deny creates a deny-by-default policy where clients will need to be specifically allowed in /etc/hosts.allow? - ✔ The ALL: ALL syntax will cause all hosts to be denied. This means that you must explicitly authorize hosts and networks using /etc/hosts.allow. Which of the following commands can be used to set the time zone on a Debian system? - ✔ . The tzconfig command can be used on a Debian system to set the time zone. The other commands listed do not exist. Which of the following commands displays the available character maps? - ✔ locale -m Which of the following commands changes the group name from admins to serveradmins? - ✔ groupmod -n serveradmins admins Which option to ping disables name resolution? - ✔ -n The drift file, as specified in /etc/ntp.conf on a Red Hat system, is stored in which location by default? - ✔ /var/lib/ntp/drift Which option to the ntpdate command configures the version to use, such that an older NTP server could be queried? - ✔ -o Within which directory are systemd journals stored by default? - ✔ /var/log/journal Which option to date changes the output to UTC regardless of the current time zone? - ✔ The -u option configures the output to UTC regardless of the time zone. The -s option sets the time, and there is no -v or -t option. Which character combination sets the body of the message to STDIN when using the mail command? - ✔ <<< Which port needs to be allowed through the firewall for standard LDAP traffic to be received by the server? - ✔ 389 Which option to ssh changes the username to use for logging into the server? - ✔ -l Which of the following commands shows various statistics for a network interface such as packets and bytes received and transmitted along with errors and other such conditions? - ✔ ifconfig Which option to dig causes it to use IPv6 only for communication? - ✔ -6 What is the limit for domains and characters when using the search option in /etc/resolv.conf? - ✔ The current limit is six domains and 256 total characters When using the host command, which option displays the SOA record from each of the authoritative DNS name servers for the given domain? - ✔ -C proper format in /etc/hosts - ✔ The proper format for /etc/hosts is IP address followed by name followed by alias, which makes answer A correct. Which of the following options to ifup tells the command to ignore errors and continue? - ✔ -ignore-errors something to remember - ✔ If /etc/cron.allow exists, then /etc/cron.deny is ignored and only those users listed in /etc/cron.allow can create cron jobs. and if neither exists, only the root can do shit. Which port should be allowed through a firewall for NTP communication? - ✔ 123 . Port 161 is SNMP, while Port 139 is NetBIOS and Port 194 is IRC. Which of the following commands retrieves the ssh host key fingerprint from a server? - ✔ ssh-keyscan Which of the following options to lsof searches an entire directory tree for open instances of files or directories? - ✔ +D You must do which of the following to define a persistent alias? - ✔ Add the command defining the alias to the appropriate shell configuration file After a user starts a BASH session and the scripts in /etc/profile are applied, what is the next file that could affect the shell session? - ✔ .bash_profile What is the full path to the directory that contains the locale configuration files on a Linux system? - ✔ /usr/share/locale Which environment variable overrides all other locale settings and sets all locales to the same setting? - ✔ LC_ALL A user is requesting that each time she logs in, a particular entry be written to a log file. This will only apply to her and she is using the Bash shell. In which configuration file would you make an entry for this action to take place? - ✔ .profile Which command should you use to convert encoding from one type to another? - ✔ iconv Some Environment Variables to remember - ✔ LC_NAME specifies personal name format. This includes things like whether the surname comes first or last. LC_NUMERIC defines formatting for numeric values that are not monetary. It affects things such as the thousands separator and the decimal separator. LC_COLLATE defines the alphabetical ordering of strings. This affects the output of sorted directory listings. You have been called in to help a small company. They want to increase the security of their small network and one of the tasks you have been given to do is to move their passwords from the /etc/passwd file to the /etc/shadow file. Which utility would you use to accomplish this? - ✔ pwconv During a Fedora distribution installation, you choose to add a regular user account. The only other user that has been added to the system was root. What is the most likely user id associated with the new user? - ✔ 500 One of your users, Karen Scott, has recently married and is now Karen Jones. She has requested that her username be changed from kscott to kjones, but no other values change. Which of the following commands will accomplish this? - ✔ usermod -l kjones kscott