Difference between revisions of "/etc/ssh/ssh config"
Jump to navigation
Jump to search
Tags: Mobile web edit, Mobile edit |
(→Errors) |
||
| (35 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| + | [[OpenSSH client]] configuration file. | ||
| + | |||
| + | Man page: https://man7.org/linux/man-pages/man5/ssh_config.5.html | ||
| + | |||
* <code>[[~/.ssh/]]config</code> | * <code>[[~/.ssh/]]config</code> | ||
* <code>/etc/ssh/ssh_config</code> | * <code>/etc/ssh/ssh_config</code> | ||
| + | == Examples == | ||
| + | == Basic example == | ||
| + | Host your_machine_name | ||
| + | Hostname IP_or_dns_name | ||
| + | User [[Default usernames|USERNAME_TO_CONNECT]] | ||
| + | [[IdentityFile]] ~/[[.ssh/id_ed25519]] #Private key | ||
| + | |||
| + | == Example with auto [[tmux]] and session persistence == | ||
| + | |||
| + | Host your_machine_name | ||
| + | Hostname IP_or_dns_name | ||
| + | User [[Default usernames|USERNAME_TO_CONNECT]] | ||
| + | [[IdentityFile]] ~/[[.ssh/id_ed25519]] #Private key | ||
| + | [[RemoteCommand]] sudo su - -c "[[tmux new]] -A -s main" | ||
| + | [[RequestTTY]] yes | ||
| + | [[ControlMaster]] auto | ||
| + | [[ControlPath]] [[~/.ssh/sockets/]]%C | ||
| + | [[ControlPersist]] 10h | ||
| + | [[ServerAliveInterval]] 60 | ||
| + | |||
| + | == Example with [[ProxyJump]] == | ||
Host machine_name_for_ssh_client | Host machine_name_for_ssh_client | ||
[[ProxyJump]] YOUR_SERVER_TO_USE_AS_JUMPSERVER | [[ProxyJump]] YOUR_SERVER_TO_USE_AS_JUMPSERVER | ||
| Line 9: | Line 34: | ||
[[IdentityFile]] ~/.ssh/id_ed25519 | [[IdentityFile]] ~/.ssh/id_ed25519 | ||
| − | [[Configure OpenSSH to reuse ssh connections]] | + | == [[Configure OpenSSH to reuse ssh connections]] == |
| + | [[RequestTTY]] yes | ||
[[ControlMaster]] auto | [[ControlMaster]] auto | ||
[[ControlPath]] ~/.ssh/sockets/%r@%h-%p | [[ControlPath]] ~/.ssh/sockets/%r@%h-%p | ||
[[ControlPersist]] 36000 | [[ControlPersist]] 36000 | ||
| − | |||
== [[OpenSSH Changelog]] == | == [[OpenSSH Changelog]] == | ||
| Line 21: | Line 46: | ||
To allow connection to some [[Cisco IOS]] devices: | To allow connection to some [[Cisco IOS]] devices: | ||
*<code>[[KexAlgorithms]] +diffie-hellman-group14-sha1</code> | *<code>[[KexAlgorithms]] +diffie-hellman-group14-sha1</code> | ||
| + | |||
| + | == Directives == | ||
| + | * <code>[[HashKnownHosts]]</code> | ||
| + | * <code>[[StrictHostKeyChecking]]</code> | ||
| + | * <code>[[KexAlgorithms]]</code> | ||
| + | * <code>[[RemoteCommand]]</code> | ||
| + | * <code>[[RequestTTY]]</code> | ||
| + | * <code>[[ServerAliveInterval]]</code> | ||
| + | * <code>[[ForwardAgent]]</code> | ||
| + | * <code>[[ProxyJump]]</code> | ||
| + | |||
| + | == Errors == | ||
| + | * <code>[[bad configuration option:]]</code> | ||
| + | |||
| + | == Activities == | ||
| + | * [[Configure OpenSSH to reuse ssh connections]] | ||
== Related terms == | == Related terms == | ||
* [[Default usernames]] | * [[Default usernames]] | ||
| − | |||
* <code>[[.pg_service.conf]]</code> | * <code>[[.pg_service.conf]]</code> | ||
| + | * <code>[[viconfig]]</code> | ||
| + | * <code>[[aws ssm start-session]]</code> | ||
| + | * <code>[[IdentityAgent]]</code> | ||
== See also == | == See also == | ||
| − | * {{ssh}} | + | * {{ssh_config}} |
| + | * {{ssh (openSSH)}} | ||
* {{OpenSSH}} | * {{OpenSSH}} | ||
[[Category:Security]] | [[Category:Security]] | ||
Latest revision as of 10:41, 24 July 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[edit]
Basic example[edit]
Host your_machine_name
Hostname IP_or_dns_name
User USERNAME_TO_CONNECT
IdentityFile ~/.ssh/id_ed25519 #Private key
Example with auto tmux and session persistence[edit]
Host your_machine_name
Hostname IP_or_dns_name
User USERNAME_TO_CONNECT
IdentityFile ~/.ssh/id_ed25519 #Private key
RemoteCommand sudo su - -c "tmux new -A -s main"
RequestTTY yes
ControlMaster auto
ControlPath ~/.ssh/sockets/%C
ControlPersist 10h
ServerAliveInterval 60
Example with ProxyJump[edit]
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[edit]
RequestTTY yes ControlMaster auto ControlPath ~/.ssh/sockets/%r@%h-%p ControlPersist 36000
OpenSSH Changelog[edit]
- 2016 OpenSSH 7.3
include include.d/your_file
To allow connection to some Cisco IOS devices:
KexAlgorithms +diffie-hellman-group14-sha1
Directives[edit]
HashKnownHostsStrictHostKeyCheckingKexAlgorithmsRemoteCommandRequestTTYServerAliveIntervalForwardAgentProxyJump
Errors[edit]
Activities[edit]
Related terms[edit]
See also[edit]
/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: