Systems Administrator Interview Question

How would you harden SSH access to a Linux server?

What the interviewer is probing, how to structure your answer, and a spoken example you can adapt.

Quick answer

Use key based authentication and disable password logins, disable direct root login so people sign in as themselves and use sudo, and limit which users or groups may connect. Restrict where SSH is reachable from with a firewall, a bastion host or a VPN rather than exposing it to the whole internet. Keep the server patched, add rate limiting such as fail2ban, monitor logins, and manage keys centrally so leavers lose access.

Why interviewers ask this

SSH is the front door to most Linux servers and a constant target for automated attacks, so the interviewer wants a layered set of controls rather than a single trick. They listen for keys instead of passwords, no direct root login, network restrictions and auditing. Mentioning key lifecycle, such as removing keys when people leave, or multi factor authentication for privileged access, shows you think beyond the configuration file.

How to structure your answer

  • Move to key based authentication and disable passwords.
  • Remove direct root login and limit who can connect.
  • Restrict network exposure with a firewall, bastion or VPN.
  • Add monitoring, rate limiting and key lifecycle management.

Example answer

Spoken example, first person

First, authentication. I switch to key based login and turn off password authentication entirely, which ends password guessing. I disable direct root login, so people sign in with their own accounts and use sudo, which ties every privileged action to a named person in the logs. I also restrict which users or groups may log in at all, so service accounts and stale accounts cannot be used over SSH. Then exposure. SSH should not be open to the whole internet unless it has to be, so I limit it with the firewall to our office ranges or a VPN, or put servers behind a bastion host that is itself locked down and logged. Changing the port cuts log noise, but I do not count it as a control. I keep the server patched, add something like fail2ban to block repeated failures, and send authentication logs to central logging so unusual logins raise an alert. The part people forget is key lifecycle. Keys should belong to individuals and be removed when someone leaves, ideally managed centrally.

Walking into this interview soon? GhostPilot listens to your live call, spots the question the moment it is asked, and puts a structured answer on your screen in real time. Try it on your next mock, or grab a $29 Session Pass, no subscription, for the real thing.

See how it works

Follow-up questions to expect

  • How would you add multi factor authentication to SSH?
  • What is SSH agent forwarding, and why can it be risky?
  • How would you revoke access for someone who has left the company?

Related systems administrator questions

Your interviewer will ask their own version of this. Paste your actual job description into the free Question Predictor and get the 20 questions that role is most likely to ask, with what each one is really probing.

Predict my questions

Rehearse the hard questions before they are asked

Practise with a live copilot, then walk in ready. A $29 Session Pass gets you through the interview with no subscription and no lock-in.

Get GhostPilot