Difference between revisions of "/etc/ssh/ssh config"
Jump to navigation
Jump to search
| Line 7: | Line 7: | ||
== Examples == | == Examples == | ||
| − | + | == Basic example == | |
Host your_machine_name | Host your_machine_name | ||
Hostname IP_or_dns_name | Hostname IP_or_dns_name | ||
User [[Default usernames|USERNAME_TO_CONNECT]] | User [[Default usernames|USERNAME_TO_CONNECT]] | ||
[[IdentityFile]] ~/[[.ssh/id_ed25519]] #Private key | [[IdentityFile]] ~/[[.ssh/id_ed25519]] #Private key | ||
| − | |||
== Example with tmux and session == | == Example with tmux and session == | ||
Revision as of 07:07, 19 March 2026
OpenSSH client configuration file.
Man page: https://man7.org/linux/man-pages/man5/ssh_config.5.html
~/.ssh/config/etc/ssh/ssh_config
Contents
Examples
Basic example
Host your_machine_name
Hostname IP_or_dns_name
User USERNAME_TO_CONNECT
IdentityFile ~/.ssh/id_ed25519 #Private key
Example with tmux and session
Host your_machine_name
Hostname IP_or_dns_name
User USERNAME_TO_CONNECT
IdentityFile ~/.ssh/id_ed25519 #Private key
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
ControlPersist 10h
Example with ProxyJump
Host machine_name_for_ssh_client
ProxyJump YOUR_SERVER_TO_USE_AS_JUMPSERVER
Hostname (IP or hostname)
Port 22
User USERNAME_TO_CONNECT
IdentityFile ~/.ssh/id_ed25519
Configure OpenSSH to reuse ssh connections
ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 36000
OpenSSH Changelog
- 2016 OpenSSH 7.3
include include.d/your_file
To allow connection to some Cisco IOS devices:
KexAlgorithms +diffie-hellman-group14-sha1
Directives
HashKnownHostsStrictHostKeyCheckingKexAlgorithmsRemoteCommandRequestTTYServerAliveIntervalForwardAgentProxyJump
Errors
Related terms
See also
/etc/ssh/ssh_config, ~/.ssh/config (man), RemoteCommand, RequestTTY, ServerAliveInterval, UseKeychain, ForwardAgent,ProxyJump, ControlMaster, ControlPath, ControlPersist- OpenSSH:
ssh(man),ssh -O,-i, -t,-T, -N, -L, -V,/etc/ssh/ssh_config,ssh --help - OpenSSH (changelog):
/etc/ssh/sshd_config|/etc/ssh/ssh_config|~/.ssh/|openSSL | sshd logs|sftp|scp|authorized_keys|ssh-keygen|ssh-keyscan|ssh-add|ssh-agent|ssh|Ssh -O stop|ssh-copy-id|CheckHostIP|UseKeychain, OpenSSF, ~/.ssh/authorized_keys
Advertising: