Situation
A separate practice SSH server runs on this machine — the lab-sshd.service unit. It listens on
127.0.0.1:2222 and reads its own settings file, /srv/ssh-lab/sshd_config; the system sshd has
nothing to do with it. The service account deploy logs in through it with a key: the client is set
up in ~/ssh-lab/config, and the login is ssh -F ~/ssh-lab/config training.
A security review found that the server lets in too many: with a password, through server questions and even as root.
Task
- The server lets people in with a key alone: neither a password nor server questions get anyone in.
- Root does not log in to this server — not even with the key that worked before — and the server offers no password.
- The new settings are in force:
lab-sshd.servicewas restarted after the edit. deploylogs in with a fresh connection:ssh -F ~/ssh-lab/config training id -unprintsdeploy.- Everything else is untouched: the other settings lines, the keys, the files in
~/ssh-laband the system SSH.
Constraints
- Edit values in
/srv/ssh-lab/sshd_configas plain lines, withoutIncludeorMatch. - Restart only
lab-sshd.service; leave the systemssh.serviceand/etc/sshalone.
The tools you need are already installed. There's no internet on this machine.
Lab goals
0 of 5-
Password, keyboard-interactive and root are denied; key-only access — not checked yet
-
The fixed configuration runs in a new lab-sshd start — not checked yet
-
A fresh deploy login with the supplied key succeeds — not checked yet
-
Root with its previously working key is refused; no password is offered — not checked yet
-
Other settings, keys and the system SSH are untouched — not checked yet
Hints
0 of 3 open · they open one at a time
Hint 1
Show the solution
after 3 failed checks