Windows
Linux
Networking
Windows ssh equivalent in Linux
Connects securely to a remote Linux, Unix or SSH-enabled system.
Windows
→
ssh
Linux equivalents
ssh user@host
ssh user@host
ssh user@host
Overview
What this command does
Connects securely to a remote Linux, Unix or SSH-enabled system.
Migration tip: SSH also supports tunnels, command execution and key-based authentication. Store host settings in
~/.ssh/config for convenience.Practical tasks
Common use cases
Open a secure remote shell
Connects securely to a remote Linux, Unix or SSH-enabled system.
ssh user@example.com
Open a remote shell
ssh -p 2222 user@example.com
Use a custom port
ssh user@example.com "uname -a"
Run one remote command
Ready to run
Copyable Linux commands
Review paths, device names, package names and permissions before running any command.
ssh user@example.com
ssh -p 2222 user@example.com
ssh user@example.com "uname -a"
Walkthrough
Examples with explanations
ssh user@example.com # connect to a remote host
ssh -p 2222 user@example.com # connect on a custom port
ssh user@example.com "uname -a" # run one command remotely
Reference
Common options and variations
| Command or option | Use |
|---|---|
ssh user@example.com | Open a remote shell |
ssh -p 2222 user@example.com | Use a custom port |
ssh user@example.com "uname -a" | Run one remote command |
Distro differences
Debian/Ubuntu vs Fedora vs Arch
This command is the same on Debian/Ubuntu, Fedora and Arch Linux when the relevant tool is installed.
| Distribution | Package manager / base | Equivalent command | Difference to notice |
|---|---|---|---|
| Debian/Ubuntu | same command | ssh user@host |
Same command on this distribution. |
| Fedora | same command | ssh user@host |
Same command on this distribution. |
| Arch | same command | ssh user@host |
Same command on this distribution. |
Important
What to watch out for
Verify the host-key fingerprint before accepting a new server key, especially on untrusted networks.
Keep learning