Difference between revisions of "/etc/ssh/ssh config"

From wikieduonline
Jump to navigation Jump to search
 
(34 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Draft}}
+
[[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
 +
 +
=== Complete example ===
 
  Host machine_name_for_ssh_client
 
  Host machine_name_for_ssh_client
     [[ProxyJump]] Optional_ProxyJump
+
     [[ProxyJump]] YOUR_SERVER_TO_USE_AS_JUMPSERVER
     Hostname IP or hostname
+
     Hostname (IP or hostname)
 
     Port 22
 
     Port 22
     User USERNAME_TO_CONNECT
+
     User [[Default usernames|USERNAME_TO_CONNECT]]
 
     [[IdentityFile]] ~/.ssh/id_ed25519
 
     [[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]]  <code>include include.d/your_file</code>
 +
 +
 +
To allow connection to some [[Cisco IOS]] devices:
 +
*<code>[[KexAlgorithms]] +diffie-hellman-group14-sha1</code>
 +
 +
== Directives ==
 +
* <code>[[HashKnownHosts]]</code>
 +
* <code>[[StrictHostKeyChecking]]</code>
 +
* <code>[[KexAlgorithms]]</code>
 +
* <code>[[RemoteCommand]]</code>
 +
* <code>[[ServerAliveInterval]]</code>
  
[[ControlMaster]] auto
+
== Errors ==
ControlPath ~/.ssh/sockets/%r@%h-%p
+
* <code>[[bad configuration option:]]</code>
ControlPersist 36000
 
  
 +
== Related terms ==
 +
* [[Default usernames]]
 +
* <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 14:59, 24 March 2023

OpenSSH client configuration file.

Man page: https://man7.org/linux/man-pages/man5/ssh_config.5.html

Examples[edit]

Basic example[edit]

Host your_machine_name
    Hostname IP_or_dns_name
    User USERNAME_TO_CONNECT
    IdentityFile ~/.ssh/id_ed25519       #Private key

Complete example[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]

ControlMaster auto
ControlPath ~/.ssh/sockets/%r@%h-%p
ControlPersist 36000

OpenSSH Changelog[edit]


To allow connection to some Cisco IOS devices:

Directives[edit]

Errors[edit]

Related terms[edit]

See also[edit]

Advertising: