Browse code

ssh_config - v1.1 - Simplify host options

See Versions section for details

Fred authored on24/02/2022 18:13:10
Showing1 changed files
... ...
@@ -1,8 +1,8 @@
1 1
 # Title: config
2 2
 # Author: Frédéric CHEVALIER <vaderf@free.fr>
3
-# Version: 0.11
3
+# Version: 1.1
4 4
 # Created in: 2015-02-18
5
-# Modified in: 2022-01-23
5
+# Modified in: 2022-02-24
6 6
 
7 7
 
8 8
 
... ...
@@ -10,7 +10,8 @@
10 10
 # Versions #
11 11
 #==========#
12 12
 
13
-# v0.11 - 2022-01-23: work domain name updated / office machine name updated / dead server discarded
13
+# v1.1 - 2022-02-24: host options simplified with matching domain / conditional jump server added
14
+# v1.0 - 2022-01-23: work domain name updated / office machine name updated / dead server discarded
14 15
 # v0.10 - 2020-11-23: work server updated
15 16
 # v0.9 - 2019-03-14: ssh options updated / work server updated
16 17
 # v0.8 - 2018-07-23: ssh options updated / work server updated
... ...
@@ -104,10 +105,7 @@ Host github_p
104 105
 
105 106
 Host heron
106 107
     HostName heron.txbiomed.org
107
-    User fcheval
108 108
     PubkeyAuthentication no
109
-    ForwardX11 yes
110
-    ForwardX11Trusted yes
111 109
     ServerAliveInterval 120
112 110
     LogLevel QUIET
113 111
 
... ...
@@ -115,39 +113,32 @@ Host heron
115 113
 
116 114
 Host zeus
117 115
     HostName zeus.txbiomed.org
118
-    User fcheval
119
-    ForwardX11 yes
120
-    ForwardX11Trusted yes
121 116
 
122 117
 Host bulmer
123 118
     HostName bulmer.txbiomed.org
124
-    User fcheval
125
-    ForwardX11 yes
126
-    ForwardX11Trusted yes
127 119
 
128 120
 Host crow
129 121
     HostName crow.txbiomed.org
130
-    User fcheval
131
-    ForwardX11 yes
132
-    ForwardX11Trusted yes
133 122
 
134 123
 Host titan
135 124
     HostName titan.txbiomed.org
136
-    User fcheval
137
-    ForwardX11 yes
138
-    ForwardX11Trusted yes
139 125
 
140 126
 # Fred office
141 127
 Host office
142 128
     HostName gen-labtechlt2.txbiomed.local
143
-    User fcheval
144
-    ForwardX11 yes
145
-    ForwardX11Trusted yes
146 129
 
147 130
 # Winka office
148 131
 Host woffice
149 132
     HostName gen-labtechlt1.txbiomed.local
150 133
     User winkal
134
+
135
+# Conditional jump host
136
+Match host !heron.txbiomed.org,*.txbiomed.org,*.txbiomed.local !exec "ping -c 1 zeus.txbiomed.org &> /dev/null"
137
+    ProxyJump heron
138
+
139
+# Default values for host in TxBiomed domain
140
+Match host *.txbiomed.org,*.txbiomed.local
141
+    User fcheval
151 142
     ForwardX11 yes
152 143
     ForwardX11Trusted yes
153 144
 
... ...
@@ -160,7 +151,7 @@ Host woffice
160 151
 # NB: These general settings must be at the end, the first value being used for each parameter (cf. man ssh_config).
161 152
 
162 153
 Host *
163
-    IdentityFile ~/.ssh/fred_work.rsa 
154
+    IdentityFile ~/.ssh/fred_work.rsa
164 155
     ForwardAgent no
165 156
     ForwardX11 no
166 157
     ForwardX11Trusted no