LFCS Certification Network Service Configuration 4 — Questions and Answers
Question 1: Which command shows active network connections, their state (ESTABLISHED, LISTEN, etc.) using the ss utility?
- ss -tulpn
- ss -s
- ss -a (Correct answer)
- ss -r
Correct answer: ss -a
ss -a displays all sockets including both listening and non-listening (established) connections.
Question 2: You need to configure a static IP on a system using NetworkManager. Which command-line tool should you use?
- ifconfig eth0 192.168.1.5 netmask 255.255.255.0
- nmcli con mod eth0 ipv4.addresses 192.168.1.5/24 (Correct answer)
- ip addr add 192.168.1.5/24 dev eth0
- route add -net 192.168.1.0/24 eth0
Correct answer: nmcli con mod eth0 ipv4.addresses 192.168.1.5/24
nmcli con mod modifies a NetworkManager connection profile to persist the static IP across reboots.
Question 3: What is the function of the /etc/nsswitch.conf file in name resolution?
- Stores DNS zone records
- Defines the order of sources (files, DNS) for name lookups (Correct answer)
- Configures the local DNS server
- Lists trusted SSL certificates
Correct answer: Defines the order of sources (files, DNS) for name lookups
/etc/nsswitch.conf controls which databases (files, dns, myhostname) are consulted and in what order for lookups.
Question 4: A Samba share should be writable by members of the 'staff' group. Which smb.conf directive sets this group?
- group = staff
- valid users = @staff
- write list = @staff (Correct answer)
- force group = staff
Correct answer: write list = @staff
write list = @staff grants write permission to members of the staff group even if the share is read-only by default.
Question 5: Which command tests that an SMTP server on localhost accepts connections on port 25?
- curl smtp://localhost:25
- telnet localhost 25 (Correct answer)
- ping localhost -p 25
- nslookup -port=25 localhost
Correct answer: telnet localhost 25
telnet to port 25 opens a raw TCP session letting you interact with the SMTP banner and issue commands.
Question 6: Which Postfix configuration file defines the main settings such as hostname, domain, and relay host?
- /etc/postfix/transport
- /etc/postfix/main.cf (Correct answer)
- /etc/postfix/master.cf
- /etc/mail/sendmail.mc
Correct answer: /etc/postfix/main.cf
main.cf is Postfix's primary configuration file containing parameters like myhostname, mydomain, and relayhost.
Question 7: Which option in /etc/ssh/sshd_config restricts SSH access to specific user accounts?
- AllowUsers (Correct answer)
- PermitUsers
- ValidUsers
- AuthorizedUsers
Correct answer: AllowUsers
AllowUsers accepts a space-separated list of usernames permitted to log in via SSH; all others are denied.
Which command shows active network connections, their state (ESTABLISHED, LISTEN, etc.) using the ss utility?