ssh web instead of ssh -p 2222 -i ~/.ssh/id_ed25519 alex@203.0.113.10. Create ~/.ssh/config on your own computer (C:\Users\<you>\.ssh\config on Windows) and add a Host web block with HostName, User, Port and IdentityFile. The same alias works with scp, sftp and rsync.
Before you start
- This file lives on your computer, not on the server.
- You need a working login first. See how to SSH into a server and SSH keys.
- PuTTY doesn’t read this file. It uses saved sessions instead.
SSH config file example
ssh web connects to 203.0.113.10 on port 2222 as alex with your Ed25519 key. ssh db first connects to web and jumps from there to a server on a private network.
What each setting does
How to create the SSH config file
- macOS / Linux
- Windows (PowerShell)
Host blocks, save with Ctrl+O, exit with Ctrl+X, then lock the file down:Why order matters
For each setting, SSH uses the first value it finds (ssh_config manual). Put specificHost blocks at the top and the catch-all Host * block at the bottom. If Host * sets User root above your Host web block, web would log in as root.
How to check it worked
ssh -G prints the settings SSH would use for a host, without connecting:
Frequently asked questions
Can I use wildcards in Host?
Yes.* matches any characters and ? matches one, so Host *.example.com covers every subdomain. A pattern starting with ! excludes a host.
SSH says “Bad owner or permissions on ~/.ssh/config”. How do I fix it?
The file must not be writable by other users. On macOS and Linux runchmod 600 ~/.ssh/config.
Can I split the file into several files?
Yes. AddInclude config.d/* near the top of ~/.ssh/config and put one file per project in ~/.ssh/config.d/. Relative paths are read from ~/.ssh.
Does VS Code Remote-SSH use this file?
Yes. Visual Studio Code’s Remote-SSH extension reads your SSH config and lists eachHost as a target.
Related guides
VPS and dedicated server guides
Every guide in this section.
Create and use SSH keys
Make the key you point IdentityFile at.
Change the SSH port
Then save it as Port here.
Copy files with scp and rsync
Use your aliases for transfers.
Keep sessions running
tmux and screen.
Checked against the official OpenSSH ssh_config manual on 4 November 2026; the example file was tested with
ssh -G, ssh, scp and sftp using OpenSSH 9.6 on Ubuntu 24.04 LTS. The Windows steps were not tested.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026