11-20 Flashcards

1
Q

A Linux administrator was asked to run a container with the httpd server inside. This container should be exposed at port 443 of a Linux host machine while it internally listens on port 8443. Which of the following commands will accomplish this task?

A. podman run -d -p 443:8443 httpd
B. podman run -d -p 8443:443 httpd
C. podman run –d -e 443:8443 httpd
D. podman exec -p 8443:443 httpd

A

A. podman run -d -p 443:8443 httpd

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

A Linux administrator needs to analyze a failing application that is running inside a container. Which of the following commands allows the Linux administrator to enter the running container and analyze the logs that are stored inside?

A. docker run -ti app /bin/sh
B. podman exec -ti app /bin/sh
C. podman run -d app /bin/bash
D. docker exec -d app /bin/bash

A

B. podman exec -ti app /bin/sh

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

A systems administrator needs to clone the partition /dev/sdc1 to /dev/sdd1. Which of the following commands will accomplish this task?

A. tar -cvzf /dev/sdd1 /dev/sdc1
B. rsync /dev/sdc1 /dev/sdd1
C. dd if=/dev/sdc1 of=/dev/sdd1
D. scp /dev/sdc1 /dev/sdd1

A

C. dd if=/dev/sdc1 of=/dev/sdd1

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

When trying to log in remotely to a server, a user receives the following message:

Password:
Last failed login: Wed Sep 15 17:23:45 CEST 2021 from 10.0.4.3 on ssh:notty
There were 3 failed login attempts since the last successful login.
Connection to the localhost closed.

The server administrator is investigating the issue on the server and receives the following outputs:

Output1:
user:x:1001:7374::/home/user:/bin/false

Output2:
dzwx———-. 2 user 62 Sep 15 17:17 /home/user

Output3:
Sep 12 14:14:05 server sshd[22958] Failed password for user from 10.0.2.8

Sep 15 17:24:03 server sshd[8460]: Accepted keyboard-interactive/pam for user from 10.0.6.5 port 50928 ssh

Sep 15 17:24:03 server sshd[8460]: pam_unix (sshd:session): session opened for user testuser

Sep 15 17:24:03 server sshd[8460]: pam_unix (sshd:session): session closed for user testuser

Which of the following is causing the issue?

A. The wrong permissions are on the user’s home directory.
B. The account was locked out due to three failed logins.
C. The user entered the wrong password.
D. The user has the wrong shell assigned to the account.

A

D. The user has the wrong shell assigned to the account.

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

A new Linux systems administrator just generated a pair of SSH keys that should allow connection to the servers. Which of the following commands can be used to copy a key file to remote servers? (Choose two.)

A. wget
B. ssh-keygen
C. ssh-keyscan
D. ssh-copy-id
E. ftpd
F. scp

A

D. ssh-copy-id

F. scp

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

A systems administrator needs to reconfigure a Linux server to allow persistent IPv4 packet forwarding. Which of the following commands is the correct way to accomplish this task?

A. echo 1 > /proc/sys/net/ipv4/ipv_forward
B. sysctl -w net.ipv4.ip_forward=1
C. firewall-cmd –enable ipv4_forwarding
D. systemctl start ipv4_forwarding

A

B. sysctl -w net.ipv4.ip_forward=1

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

A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?

A. The checkdiskspace.service is not running.
B. The checkdiskspace.service needs to be enabled.
C. The OnCalendar schedule is incorrect in the timer definition.
D. The system-daemon services need to be reloaded.

A

D. The system-daemon services need to be reloaded.

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

An administrator deployed a Linux server that is running a web application on port 6379/tcp.
SELinux is in enforcing mode based on organization policies.
The port is open on the firewall.
Users who are trying to connect to a local instance of the web application receive Error 13, Permission denied.
The administrator ran some commands that resulted in the following output:

semanage port -1 | egrep ‘(^http_port_t|6379)’
http_port_t tcp 80, 81, 443, 488, 8008, 8009, 8443, 9000

curl http://localhost/App.php
Cannot connect to App Server.

Which of the following commands should be used to resolve the issue?

A. semanage port -d -t http_port_t -p tcp 6379
B. semanage port -a -t http_port_t -p tcp 6379
C. semanage port -a http_port_t -p top 6379
D. semanage port -l -t http_port_tcp 6379

A

B. semanage port -a -t http_port_t -p tcp 6379

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

A systems administrator created a web server for the company and is required to add a tag for the API so end users can connect. Which of the following would the administrator do to complete this requirement?

A. hostnamectl status –no-ask-password
B. hostnamectl set-hostname “$(perl -le “print” “A” x 86)”
C. hostnamectl set-hostname Comptia-WebNode -H root@192.168.2.14
D. hostnamectl set-hostname Comptia-WebNode –transient

A

C. hostnamectl set-hostname Comptia-WebNode -H root@192.168.2.14

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

A systems administrator wants to back up the directory /data and all its contents to /backup/data on a remote server named remote. Which of the following commands will achieve the desired effect?

A. scp -p /data remote:/backup/data
B. ssh -i /remote:/backup/ /data
C. rsync -a /data remote:/backup/
D. cp -r /data /remote/backup/

A

C. rsync -a /data remote:/backup/

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