Put your key on the server and log in without a password
The server keeps allowed public keys in ~/.ssh/authorized_keys of the account you log in as — one key per line.
Copy the key — from PowerShell (one line)
type $env:USERPROFILE\.ssh\id_ed25519.pub | ssh student@203.0.113.10 "umask 077; mkdir -p ~/.ssh; cat >> ~/.ssh/authorized_keys"
You type the account password one last time. On Linux or macOS the same job is ssh-copy-id student@203.0.113.10.
Copy the key — by hand in PuTTY
mkdir -p ~/.ssh && chmod 700 ~/.ssh nano ~/.ssh/authorized_keys # paste the ONE line, save chmod 600 ~/.ssh/authorized_keys
The permissions matter: sshd ignores the file if the folder or file can be written by others.
Tell PuTTY to use the key
- Load the
labsession. - Connection → SSH → Auth → Credentials → Private key file for authentication: browse to
id_ed25519.ppk. - Session → Save. Open it: you are asked for the key passphrase, not the account password.
See it work
ssh -v shows each step of the login. This is a real run:

When it does not work
| # | Symptom | Usual cause | Fix |
|---|---|---|---|
| 1 | Still asks for the account password | Key not loaded in PuTTY, or wrong user | Check Auth → Credentials path; check the user name |
| 2 | Permission denied (publickey) | Key line missing or broken (wrapped onto two lines) | cat ~/.ssh/authorized_keys — one line per key |
| 3 | Key ignored, works for root only | Permissions too open | chmod 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys |
| 4 | “Server refused our key” | Server does not allow keys, or key type not accepted | Ask the admin to check sshd -T (below) |
| 5 | “REMOTE HOST IDENTIFICATION HAS CHANGED” | Server rebuilt — or someone in the middle | Confirm with the admin before deleting the old entry |

Server side — what is allowed

Hardening once keys work (admin task, in /etc/ssh/sshd_config.d/10-keys.conf):
PasswordAuthentication no PermitRootLogin prohibit-password KbdInteractiveAuthentication no
Then sshd -t && systemctl reload ssh — and keep your current session open until a new session logs in fine.
Try it — password-free login
- Install your public key on the lab server.
- Log in with PuTTY using the .ppk — you should only be asked for the passphrase.
- From PowerShell run
ssh -v student@<lab> trueand find the line with your fingerprint.
Rating
0
0
There are no comments for now.
Join this Course
to be the first to leave a comment.