Linux · SSH & Security interview questions

66 Linux · SSH & Security questions from the System Administration bank, written for Indian campus drives and tech interviews. Every question has a verified answer and an AI-tutor explanation on placd.

Free to start: the 2-minute IT readiness check — six questions and a result.

Take the free IT readiness check

or take a mock interview set up for this area

1. What does ssh-keygen do?

Junior
  1. A.show the SELinux context of files
  2. B.copy a file to a remote host over SSH
  3. C.persistently enable an SELinux boolean
  4. D.generate an SSH public/private key pair

Answer + AI explanation with Pro

2. Which command will generate an SSH public/private key pair?

Junior
  1. A.ssh -L 8080:localhost:80 host
  2. B.setsebool -P httpd_can_network_connect on
  3. C.getenforce
  4. D.ssh-keygen

Answer + AI explanation with Pro

3. Which statement is correct?

Junior
  1. A.ssh-keygen — generate an SELinux policy from denial logs
  2. B.ssh-keygen — generate an SSH public/private key pair
  3. C.ssh-keygen — install your public key on a host for passwordless login
  4. D.ssh-keygen — copy a file to a remote host over SSH

Answer + AI explanation with Pro

4. What does ssh-copy-id user@host do?

Junior
  1. A.let SELinux allow a service on a custom port
  2. B.generate an SELinux policy from denial logs
  3. C.switch SELinux to enforcing mode temporarily
  4. D.install your public key on a host for passwordless login

Answer + AI explanation with Pro

5. Which command will install your public key on a host for passwordless login?

Junior
  1. A.ssh-copy-id user@host
  2. B.scp file user@host:/tmp
  3. C.ls -Z
  4. D.getenforce

Answer + AI explanation with Pro

6. Which statement is correct?

Junior
  1. A.ssh-copy-id user@host — install your public key on a host for passwordless login
  2. B.ssh-copy-id user@host — connect over SSH on a non-default port
  3. C.ssh-copy-id user@host — let SELinux allow a service on a custom port
  4. D.ssh-copy-id user@host — show the SELinux context of files

Answer + AI explanation with Pro

7. What does restorecon -Rv /var/www/html do?

Mid
  1. A.switch SELinux to enforcing mode temporarily
  2. B.reset SELinux contexts to the policy default recursively
  3. C.connect over SSH on a non-default port
  4. D.copy a file to a remote host over SSH

Answer + AI explanation with Pro

8. Which command will reset SELinux contexts to the policy default recursively?

Mid
  1. A.setenforce 1
  2. B.semanage port -a -t http_port_t -p tcp 8080
  3. C.restorecon -Rv /var/www/html
  4. D.ls -Z

Answer + AI explanation with Pro

9. Which statement is correct?

Mid
  1. A.restorecon -Rv /var/www/html — install your public key on a host for passwordless login
  2. B.restorecon -Rv /var/www/html — reset SELinux contexts to the policy default recursively
  3. C.restorecon -Rv /var/www/html — switch SELinux to enforcing mode temporarily
  4. D.restorecon -Rv /var/www/html — copy a file to a remote host over SSH

Answer + AI explanation with Pro

10. What does getenforce do?

Junior
  1. A.let SELinux allow a service on a custom port
  2. B.print the current SELinux mode
  3. C.create a local SSH port-forward tunnel
  4. D.generate an SELinux policy from denial logs

Answer + AI explanation with Pro

11. Which command will print the current SELinux mode?

Junior
  1. A.ssh -p 2222 user@host
  2. B.setsebool -P httpd_can_network_connect on
  3. C.semanage port -a -t http_port_t -p tcp 8080
  4. D.getenforce

Answer + AI explanation with Pro

12. Which statement is correct?

Junior
  1. A.getenforce — persistently enable an SELinux boolean
  2. B.getenforce — generate an SSH public/private key pair
  3. C.getenforce — print the current SELinux mode
  4. D.getenforce — copy a file to a remote host over SSH

Answer + AI explanation with Pro

13. What does setsebool -P httpd_can_network_connect on do?

Mid
  1. A.install your public key on a host for passwordless login
  2. B.show the SELinux context of files
  3. C.generate an SSH public/private key pair
  4. D.persistently enable an SELinux boolean

Answer + AI explanation with Pro

14. Which command will persistently enable an SELinux boolean?

Mid
  1. A.ssh-copy-id user@host
  2. B.semanage port -a -t http_port_t -p tcp 8080
  3. C.setsebool -P httpd_can_network_connect on
  4. D.ssh -p 2222 user@host

Answer + AI explanation with Pro

15. Which statement is correct?

Mid
  1. A.setsebool -P httpd_can_network_connect on — generate an SELinux policy from denial logs
  2. B.setsebool -P httpd_can_network_connect on — connect over SSH on a non-default port
  3. C.setsebool -P httpd_can_network_connect on — show the SELinux context of files
  4. D.setsebool -P httpd_can_network_connect on — persistently enable an SELinux boolean

Answer + AI explanation with Pro

16. What does ls -Z do?

Junior
  1. A.switch SELinux to enforcing mode temporarily
  2. B.reset SELinux contexts to the policy default recursively
  3. C.show the SELinux context of files
  4. D.generate an SELinux policy from denial logs

Answer + AI explanation with Pro

17. Which command will show the SELinux context of files?

Junior
  1. A.audit2allow
  2. B.ssh -L 8080:localhost:80 host
  3. C.ls -Z
  4. D.getenforce

Answer + AI explanation with Pro

18. Which statement is correct?

Junior
  1. A.ls -Z — create a local SSH port-forward tunnel
  2. B.ls -Z — show the SELinux context of files
  3. C.ls -Z — copy a file to a remote host over SSH
  4. D.ls -Z — let SELinux allow a service on a custom port

Answer + AI explanation with Pro

19. What is SELinux Enforcing mode?

Junior
  1. A.the sshd setting that forces key-only authentication
  2. B.a tool that bans IPs after repeated failed login attempts
  3. C.layering multiple independent security controls
  4. D.the mode that blocks and logs policy violations

Answer + AI explanation with Pro

20. Which term means: "the mode that blocks and logs policy violations"?

Junior
  1. A.SELinux type enforcement
  2. B.SELinux Enforcing mode
  3. C.PermitRootLogin no
  4. D.CIS benchmark

Answer + AI explanation with Pro

21. Which statement is correct?

Junior
  1. A.SELinux Enforcing mode — a hardening standard of recommended secure configurations
  2. B.SELinux Enforcing mode — the SELinux model labeling processes and files with types
  3. C.SELinux Enforcing mode — a hardened jump host that gates SSH access to internal servers
  4. D.SELinux Enforcing mode — the mode that blocks and logs policy violations

Answer + AI explanation with Pro

22. What is SELinux Permissive mode?

Junior
  1. A.layering multiple independent security controls
  2. B.the SELinux model labeling processes and files with types
  3. C.a tool that bans IPs after repeated failed login attempts
  4. D.the mode that logs policy violations but does not block them

Answer + AI explanation with Pro

23. Which term means: "the mode that logs policy violations but does not block them"?

Junior
  1. A.SSH bastion host
  2. B.sshd_config
  3. C.SELinux Enforcing mode
  4. D.SELinux Permissive mode

Answer + AI explanation with Pro

24. Which statement is correct?

Junior
  1. A.SELinux Permissive mode — a hardening standard of recommended secure configurations
  2. B.SELinux Permissive mode — the SELinux model labeling processes and files with types
  3. C.SELinux Permissive mode — a hardened jump host that gates SSH access to internal servers
  4. D.SELinux Permissive mode — the mode that logs policy violations but does not block them

Answer + AI explanation with Pro

25. What is PermitRootLogin no?

Senior
  1. A.the SELinux model labeling processes and files with types
  2. B.the mode that logs policy violations but does not block them
  3. C.the sshd setting that forces key-only authentication
  4. D.the sshd setting that disables direct root SSH login for hardening

Answer + AI explanation with Pro

26. Which term means: "the sshd setting that disables direct root SSH login for hardening"?

Senior
  1. A.SELinux type enforcement
  2. B.PasswordAuthentication no
  3. C.SELinux Enforcing mode
  4. D.PermitRootLogin no

Answer + AI explanation with Pro

27. Which statement is correct?

Senior
  1. A.PermitRootLogin no — a hardened jump host that gates SSH access to internal servers
  2. B.PermitRootLogin no — the OpenSSH server configuration file
  3. C.PermitRootLogin no — a hardening standard of recommended secure configurations
  4. D.PermitRootLogin no — the sshd setting that disables direct root SSH login for hardening

Answer + AI explanation with Pro

28. What does ssh -p 2222 user@host do?

Junior
  1. A.print the current SELinux mode
  2. B.connect over SSH on a non-default port
  3. C.copy a file to a remote host over SSH
  4. D.let SELinux allow a service on a custom port

Answer + AI explanation with Pro

29. Which command will connect over SSH on a non-default port?

Junior
  1. A.scp file user@host:/tmp
  2. B.setsebool -P httpd_can_network_connect on
  3. C.ssh-copy-id user@host
  4. D.ssh -p 2222 user@host

Answer + AI explanation with Pro

30. Which statement is correct?

Junior
  1. A.ssh -p 2222 user@host — switch SELinux to enforcing mode temporarily
  2. B.ssh -p 2222 user@host — copy a file to a remote host over SSH
  3. C.ssh -p 2222 user@host — generate an SSH public/private key pair
  4. D.ssh -p 2222 user@host — connect over SSH on a non-default port

Answer + AI explanation with Pro

Showing 30 of 66 Linux · SSH & Security questions — the full set, with answers, explanations and an AI tutor on every question, is inside.

Free to start

Start with a free readiness check

Sign up free for the 2-minute IT readiness check and a scored result. Answers, explanations and the AI tutor on every Linux · SSH & Security question come with Pro.

Take the free IT readiness check

or take a mock interview set up for this area

24,000+ questions & coding problemsSoftware & IT16,274 questionsGovernment jobs26 examsAptitudenew questions every timeAI practice interviewwith feedback65 topics to practiseMechanical1,149 questionsGATE ME9 papersEngineering Mathematics381 questions2-minute checkfreeDSA Problems1,422Civil1,005 questionsGATE CE9 papersCS Fundamentals1,209 questionsYour scores6 skillsSystem Design25Electrical / EEE1,047 questionsGATE EE9 papersRun your codeC++ · Java · PythonLow-Level Design144Electronics & Comm.975 questionsGATE EC9 papersAI help on every questionFull-Stack6,282Chemical1,005 questionsGATE CH9 papersAI whiteboardsystem designWork abroadEurope · remote · transfersESE ME1 paperGATE practice papers2019–2026ESE CE1 paperDate alertsbefore the last dateESE EE1 paperBehavioural courseHR round practiceESE ET1 paperResume optimizerProSSC JE ME1 paperApplication trackerSSC JE CE1 paperCompany-wise prepSSC JE EE1 paperRole roadmapsRRB JE1 subjectPriced in ₹UPI · cardsISRO SC1 paperGATE CS9 papersIBPS SO IT1 paperUGC NET CS1 paperSSC CGL26 papersIBPS PO26 papersRRB NTPC26 papersSSC CHSL26 papersIBPS Clerk26 papersSBI Clerk26 papersRRB Group D26 papersSSC CPO26 papersSSC GD26 papers