71-80 Flashcards

1
Q

Some servers in an organization have been compromised. Users are unable to access to the organization’s web page and other services. While reviewing the system log, a systems administrator notices messages from the kernel regarding firewall rules:

Oct 20 03:45:50 hostname kernel: iptables denied: IN=eth0 OUT=
MAC=XX:XX:X:X SRC=x.x.x.x DST=x.x.x.x LEN=1059 TOS=0x00
PREC=0x00 TTL-115 ID=31368 DF PROTO=TCP
SPT=17992 DPT=80 WINDOW=16477 RES=0x00 ACK PSH URGP=0

Oct 20 03:46:02 hostname kernel: iptables denied: IN=eth0 OUT=
MAC=XX:XX:X:X SRC=x.x.x.x DST=x.x.x.x LEN=52 TOS=0x00
PREC=0x00 TTL=52 ID=763 DF PROTO=TCP SPT=20229 DPT=22 WINDOW=15598 RES=0x00 ACK URGP=0

Oct 20 03:46:14 hostname kernel: iptables denied: IN=eth0 OUT=
MAC=XX:XX:X:X SRC=x.x.x.x DST=x.x.x.x LEN=324 TOS=0x00
PREC=0x00 TTL=49 ID=64245 DF PROTO=TCP SPT=47237 DPT=80 WINDOW=470 RES=0x00 ACK URGP=0

Oct 20 03:46:26 hostname kernel: iptables denied: IN=eth0 OUT=
MAC=XX:XX:X:X SRC=x.x.x.x DST=x.x.x.x LEN=52 TOS=0x00
PREC=0x00 TTL=45 ID=2010 DF PROTO=TCP SPT=48322 DPT=80 WINDOW=80 RES=0x00 ACK URGP=0

Which of the following commands will remediate and help resolve the issue?

A.
IPtables -A FORWARD -i eth0 -p tcp –dport 80 -j ACCEPT
IPtables -A FORWARD -i eth0 -p tcp –dport 22 -j ACCEPT

B.
IPtables -A INPUT -i eth0 -p tcp –dport 80 -j ACCEPT
IPtables -A INPUT -i eth0 -p tcp –dport 22 -j ACCEPT

C.
IPtables -A INPUT -i eth0 -p tcp –sport 80 -j ACCEPT
IPtables -A INPUT -i eth0 -p tcp –sport 22 -j ACCEPT

D.
IPtables -A INPUT -i eth0 -p tcp –dport :80 -j ACCEPT
IPtables -A INPUT -i eth0 -p tcp –dport :22 -j ACCEPT

A

B.
IPtables -A INPUT -i eth0 -p tcp –dport 80 -j ACCEPT
IPtables -A INPUT -i eth0 -p tcp –dport 22 -j ACCEPT

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

A junior administrator is trying to set up a passwordless SSH connection to one of the servers. The administrator follows the instructions and puts the key in the authorized_key file at the server, but the administrator is still asked to provide a password during the connection.
Given the following output:

junior@server:-$ ls -lh .ssh/auth*
-rw————– 1 junior junior 566 sep 13 20:56 .ssh/authorized_key

Which of the following commands would resolve the issue and allow an SSH connection to be established without a password?

A. restorecon -rv .ssh/authorized_key
B. mv .ssh/authorized_key .ssh/authorized_keys
C. systemctl restart sshd.service
D. chmod 600 mv .ssh/authorized_key

A

B. mv .ssh/authorized_key .ssh/authorized_keys

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

A Linux administrator needs to resolve a service that has failed to start. The administrator runs the following command:

ls -1 startup file

The following output is returned

————–. root root 81k Sep 13 19:01 startupfile

Which of the following is MOST likely the issue?

A. The service does not have permissions to read write the startupfile.
B. The service startupfile size cannot be 81k.
C. The service startupfile cannot be owned by root.
D. The service startupfile should not be owned by the root group.

A

A. The service does not have permissions to read write the startupfile.

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

A Linux engineer is setting the sticky bit on a directory called devops with 755 file permission. Which of the following commands will accomplish this task?

A. chown -s 755 devops
B. chown 1755 devops
C. chmod -s 755 devops
D. chmod 1755 devops

A

D. chmod 1755 devops

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

A Linux administrator booted up the server and was presented with a non-GUI terminal. The administrator ran the command systemctl isolate graphical.target and rebooted the system by running systemctl reboot, which fixed the issue. However, the next day the administrator was presented again with a non-GUI terminal. Which of the following is the issue?

A. The administrator did not reboot the server properly.
B. The administrator did not set the default target to basic.target.
C. The administrator did not set the default target to graphical.target.
D. The administrator did not shut down the server properly.

A

C. The administrator did not set the default target to graphical.target.

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

Users report that connections to a MariaDB service are being closed unexpectedly. A systems administrator troubleshoots the issue and finds the following message in /var/log/messages:

dbserver kernel: out of Memory: Killed process 1234 (mysqld).

Which of the following is causing the connection issue?

A. The process mysqld is using too many semaphores.
B. The server is running out of file descriptors.
C. Something is starving the server resources.
D. The amount of RAM allocated to the server is too high.

A

A. The process mysqld is using too many semaphores.

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

A developer is trying to install an application remotely that requires a graphical interface for installation. The developer requested assistance to set up the necessary environment variables along with X11 forwarding in SSH. Which of the following environment variables must be set in remote shell in order to launch the graphical interface?

A. $RHOST
B. SETENV
C. $SHELL
D. $DISPLAY

A

D. $DISPLAY

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

A systems administrator is implementing a new service task with systems at startup and needs to execute a script entitled test.sh with the following content:

TIMESTAMP=$ (date ‘+%Y-%m-%d %H:%M:%S’)
echo “helpme.service: timestamp $ (Timestamp)” | systemd-cat -p info
sleep 60
done

The administrator tries to run the script after making it executable with chmod +x; however, the script will not run. Which of the following should the administrator do to address this issue? (Choose two.)

A. Add #!/bin/bash to the bottom of the script.
B. Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location.
C. Add #!//bin/bash to the top of the script.
D. Restart the computer to enable the new service.
E. Create a unit file for the new service in /etc/init.d with the name helpme.service in the location.
F. Shut down the computer to enable the new service.

A

B. Create a unit file for the new service in /etc/systemd/system/ with the name helpme.service in the location. Most Voted

C. Add #!//bin/bash to the top of the script.

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

A Linux administrator needs to correct the permissions of a log file on the server. Which of the following commands should be used to set filename.log permissions to -rwxr—r–. ?

A. chmod 755 filename.log
B. chmod 640 filename.log
C. chmod 740 filename.log
D. chmod 744 filename.log

A

D. chmod 744 filename.log

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

After listing the properties of a system account, a systems administrator wants to remove the expiration date of a user account. Which of the following commands will accomplish this task?

A. chgrp system accountname
B. passwd –s accountname
C. chmod -G system account name
D. chage -E -1 accountname

A

D. chage -E -1 accountname

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