~/.ssh/config — names instead of addresses
The OpenSSH client (Windows PowerShell, Linux, macOS, Git) reads ~/.ssh/config — on Windows C:\Users\you\.ssh\config with no file extension. Each Host block gives a short name its address, user and key.
Host lab
HostName 203.0.113.10
User student
IdentityFile ~/.ssh/id_ed25519
ServerAliveInterval 30
Host *.bp-lab.example
User student
IdentityFile ~/.ssh/id_ed25519
Now ssh lab, scp file.txt lab: and git clone over SSH all use those settings. ssh -G shows what OpenSSH resolved — a real run:

Useful options
| # | Option | What it does |
|---|---|---|
| 1 | Port 2222 | Non-standard SSH port |
| 2 | ProxyJump bastion | Reach an inside server through a jump host in one command |
| 3 | LocalForward 15432 127.0.0.1:5432 | Tunnel: your PC's port 15432 reaches PostgreSQL on the server |
| 4 | IdentitiesOnly yes | Offer only the listed key (avoids “too many authentication failures”) |
WinSCP can import these hosts: Tools → Import Sites → OpenSSH config; it offers to convert the IdentityFile key to .ppk.
Try it — config file
- Create the
configfile with alabentry. - Run
ssh lab hostnamefrom PowerShell. - Run
ssh -G lab | findstr /b "hostname user port".
Rating
0
0
There are no comments for now.
Join this Course
to be the first to leave a comment.