Debian Codegraph @

ansible_collections/dellemc/enterprise_sonic/docs/dellemc.enterprise_sonic.sonic_ssh_server_module.rst

raw
1 .. _dellemc.enterprise_sonic.sonic_ssh_server_module:
2
3
4 *****************************************
5 dellemc.enterprise_sonic.sonic_ssh_server
6 *****************************************
7
8 **Manage SSH server configurations on SONiC**
9
10
11 Version added: 3.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - This module provides SSH server configuration management to specify the algorithms used for SSH connection in devices running SONiC.
21
22
23
24
25 Parameters
26 ----------
27
28 .. raw:: html
29
30 <table border=0 cellpadding=0 class="documentation-table">
31 <tr>
32 <th colspan="3">Parameter</th>
33 <th>Choices/<font color="blue">Defaults</font></th>
34 <th width="100%">Comments</th>
35 </tr>
36 <tr>
37 <td colspan="3">
38 <div class="ansibleOptionAnchor" id="parameter-"></div>
39 <b>config</b>
40 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
41 <div style="font-size: small">
42 <span style="color: purple">dictionary</span>
43 </div>
44 </td>
45 <td>
46 </td>
47 <td>
48 <div>SSH servers use the following configurations for SSH connections.</div>
49 </td>
50 </tr>
51 <tr>
52 <td class="elbow-placeholder"></td>
53 <td colspan="2">
54 <div class="ansibleOptionAnchor" id="parameter-"></div>
55 <b>server_globals</b>
56 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
57 <div style="font-size: small">
58 <span style="color: purple">dictionary</span>
59 </div>
60 </td>
61 <td>
62 </td>
63 <td>
64 <div>SSH server global configuration.</div>
65 <div>For options of &#x27;str&#x27; type, deletion results in restoring them to their default values.</div>
66 </td>
67 </tr>
68 <tr>
69 <td class="elbow-placeholder"></td>
70 <td class="elbow-placeholder"></td>
71 <td colspan="1">
72 <div class="ansibleOptionAnchor" id="parameter-"></div>
73 <b>ciphers</b>
74 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75 <div style="font-size: small">
76 <span style="color: purple">string</span>
77 </div>
78 </td>
79 <td>
80 </td>
81 <td>
82 <div>Configure ciphers on ssh server.</div>
83 <div>Defaults are aes128-ctr,aes192-ctr,aes256-ctr,[email protected], [email protected],[email protected].</div>
84 </td>
85 </tr>
86 <tr>
87 <td class="elbow-placeholder"></td>
88 <td class="elbow-placeholder"></td>
89 <td colspan="1">
90 <div class="ansibleOptionAnchor" id="parameter-"></div>
91 <b>disable_forwarding</b>
92 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
93 <div style="font-size: small">
94 <span style="color: purple">boolean</span>
95 </div>
96 </td>
97 <td>
98 <ul style="margin: 0; padding: 0"><b>Choices:</b>
99 <li>no</li>
100 <li>yes</li>
101 </ul>
102 </td>
103 <td>
104 <div>Configure disable forwarding on ssh server.</div>
105 <div>Default is False.</div>
106 </td>
107 </tr>
108 <tr>
109 <td class="elbow-placeholder"></td>
110 <td class="elbow-placeholder"></td>
111 <td colspan="1">
112 <div class="ansibleOptionAnchor" id="parameter-"></div>
113 <b>hostkeyalgorithms</b>
114 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
115 <div style="font-size: small">
116 <span style="color: purple">string</span>
117 </div>
118 </td>
119 <td>
120 </td>
121 <td>
122 <div>Configure hostkey algorithms on ssh server.</div>
123 <div>Defaults are ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,rsa-sha2-256,rsa-sha2-512,ssh-rsa.</div>
124 </td>
125 </tr>
126 <tr>
127 <td class="elbow-placeholder"></td>
128 <td class="elbow-placeholder"></td>
129 <td colspan="1">
130 <div class="ansibleOptionAnchor" id="parameter-"></div>
131 <b>kexalgorithms</b>
132 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
133 <div style="font-size: small">
134 <span style="color: purple">string</span>
135 </div>
136 </td>
137 <td>
138 </td>
139 <td>
140 <div>Configure key exchange algorithms.</div>
141 <div>Defaults are curve25519-sha256,[email protected],ecdh-sha2-nistp256, ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256, diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,</div>
142 </td>
143 </tr>
144 <tr>
145 <td class="elbow-placeholder"></td>
146 <td class="elbow-placeholder"></td>
147 <td colspan="1">
148 <div class="ansibleOptionAnchor" id="parameter-"></div>
149 <b>macs</b>
150 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
151 <div style="font-size: small">
152 <span style="color: purple">string</span>
153 </div>
154 </td>
155 <td>
156 </td>
157 <td>
158 <div>Configure macs on ssh server.</div>
159 <div>Defaults are [email protected],[email protected], [email protected],[email protected],hmac-sha2-256,hmac-sha2-512.</div>
160 </td>
161 </tr>
162 <tr>
163 <td class="elbow-placeholder"></td>
164 <td class="elbow-placeholder"></td>
165 <td colspan="1">
166 <div class="ansibleOptionAnchor" id="parameter-"></div>
167 <b>max_auth_retries</b>
168 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
169 <div style="font-size: small">
170 <span style="color: purple">integer</span>
171 </div>
172 </td>
173 <td>
174 </td>
175 <td>
176 <div>Number of authentication retries allowed before session terminates.</div>
177 <div>Range 0-10.</div>
178 <div>Default is 6.</div>
179 </td>
180 </tr>
181 <tr>
182 <td class="elbow-placeholder"></td>
183 <td class="elbow-placeholder"></td>
184 <td colspan="1">
185 <div class="ansibleOptionAnchor" id="parameter-"></div>
186 <b>password_authentication</b>
187 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
188 <div style="font-size: small">
189 <span style="color: purple">boolean</span>
190 </div>
191 </td>
192 <td>
193 <ul style="margin: 0; padding: 0"><b>Choices:</b>
194 <li>no</li>
195 <li>yes</li>
196 </ul>
197 </td>
198 <td>
199 <div>Configure password authentication on ssh server.</div>
200 <div>By default it is enabled.</div>
201 <div>Default is True.</div>
202 </td>
203 </tr>
204 <tr>
205 <td class="elbow-placeholder"></td>
206 <td class="elbow-placeholder"></td>
207 <td colspan="1">
208 <div class="ansibleOptionAnchor" id="parameter-"></div>
209 <b>permit_root_login</b>
210 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
211 <div style="font-size: small">
212 <span style="color: purple">boolean</span>
213 </div>
214 </td>
215 <td>
216 <ul style="margin: 0; padding: 0"><b>Choices:</b>
217 <li>no</li>
218 <li>yes</li>
219 </ul>
220 </td>
221 <td>
222 <div>Configure permit root login on ssh server.</div>
223 <div>Default is False.</div>
224 </td>
225 </tr>
226 <tr>
227 <td class="elbow-placeholder"></td>
228 <td class="elbow-placeholder"></td>
229 <td colspan="1">
230 <div class="ansibleOptionAnchor" id="parameter-"></div>
231 <b>permit_user_environment</b>
232 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
233 <div style="font-size: small">
234 <span style="color: purple">boolean</span>
235 </div>
236 </td>
237 <td>
238 <ul style="margin: 0; padding: 0"><b>Choices:</b>
239 <li>no</li>
240 <li>yes</li>
241 </ul>
242 </td>
243 <td>
244 <div>Configure permit user environment on ssh server.</div>
245 <div>Default is False.</div>
246 </td>
247 </tr>
248 <tr>
249 <td class="elbow-placeholder"></td>
250 <td class="elbow-placeholder"></td>
251 <td colspan="1">
252 <div class="ansibleOptionAnchor" id="parameter-"></div>
253 <b>permit_user_rc</b>
254 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
255 <div style="font-size: small">
256 <span style="color: purple">boolean</span>
257 </div>
258 </td>
259 <td>
260 <ul style="margin: 0; padding: 0"><b>Choices:</b>
261 <li>no</li>
262 <li>yes</li>
263 </ul>
264 </td>
265 <td>
266 <div>Configure permit user rc on ssh server.</div>
267 <div>Default is True.</div>
268 </td>
269 </tr>
270 <tr>
271 <td class="elbow-placeholder"></td>
272 <td class="elbow-placeholder"></td>
273 <td colspan="1">
274 <div class="ansibleOptionAnchor" id="parameter-"></div>
275 <b>publickey_authentication</b>
276 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
277 <div style="font-size: small">
278 <span style="color: purple">boolean</span>
279 </div>
280 </td>
281 <td>
282 <ul style="margin: 0; padding: 0"><b>Choices:</b>
283 <li>no</li>
284 <li>yes</li>
285 </ul>
286 </td>
287 <td>
288 <div>Configure publickey authentication on ssh server.</div>
289 <div>Default is True.</div>
290 </td>
291 </tr>
292 <tr>
293 <td class="elbow-placeholder"></td>
294 <td class="elbow-placeholder"></td>
295 <td colspan="1">
296 <div class="ansibleOptionAnchor" id="parameter-"></div>
297 <b>x11_forwarding</b>
298 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
299 <div style="font-size: small">
300 <span style="color: purple">boolean</span>
301 </div>
302 </td>
303 <td>
304 <ul style="margin: 0; padding: 0"><b>Choices:</b>
305 <li>no</li>
306 <li>yes</li>
307 </ul>
308 </td>
309 <td>
310 <div>Configure x11 forwarding on ssh server.</div>
311 <div>Default is False.</div>
312 </td>
313 </tr>
314
315
316 <tr>
317 <td colspan="3">
318 <div class="ansibleOptionAnchor" id="parameter-"></div>
319 <b>state</b>
320 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
321 <div style="font-size: small">
322 <span style="color: purple">string</span>
323 </div>
324 </td>
325 <td>
326 <ul style="margin: 0; padding: 0"><b>Choices:</b>
327 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
328 <li>deleted</li>
329 <li>replaced</li>
330 <li>overridden</li>
331 </ul>
332 </td>
333 <td>
334 <div>The state of the configuration after module completion.</div>
335 </td>
336 </tr>
337 </table>
338 <br/>
339
340
341
342
343 Examples
344 --------
345
346 .. code-block:: yaml
347
348 # Using "deleted" state
349 #
350 # Before state:
351 # -------------
352 #
353 # sonic# show running-configuration | grep "ip ssh"
354 # ip ssh disable-publickey-authentication true
355 # sonic#
356
357 - name: Delete specified SSH configurations
358 dellemc.enterprise_sonic.sonic_ssh_server:
359 config:
360 server_globals:
361 publickey_authentication: false
362 state: deleted
363
364 # After state:
365 # ------------
366 #
367 # sonic# show running-configuration | grep "ip ssh"
368 # ip ssh disable-publickey-authentication false
369 # sonic#
370
371
372 # Using "merged" state
373 #
374 # Before state:
375 # -------------
376 #
377 # sonic# show running-configuration | grep "ip ssh"
378 # ip ssh disable-publickey-authentication false
379 # sonic#
380
381 - name: Modify SSH configurations
382 dellemc.enterprise_sonic.sonic_ssh_server:
383 config:
384 server_globals:
385 publickey_authentication: false
386 state: merged
387
388 # After state:
389 # ------------
390 #
391 # sonic# show running-configuration | grep "ip ssh"
392 # ip ssh disable-publickey-authentication true
393 # sonic#
394
395
396 # Using "replaced" state
397 #
398 # Before state:
399 # -------------
400 #
401 # sonic# show running-configuration | grep "ip ssh client"
402 # ip ssh client ciphers aes192-ctr,[email protected]
403 # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512
404 # ip ssh client macs [email protected],[email protected]
405 # sonic#
406
407 - name: Replace SSH configurations
408 dellemc.enterprise_sonic.sonic_ssh:
409 config:
410 server_globals:
411 cipher: 'aes256-ctr'
412 kex: 'curve25519-sha256,diffie-hellman-group16-sha512'
413 state: replaced
414
415 # After state:
416 # ------------
417 #
418 # sonic# show running-configuration | grep "ip ssh client"
419 # ip ssh client ciphers aes256-ctr
420 # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512
421 # sonic#
422
423
424 # Using "overridden" state
425 #
426 # Before state:
427 # -------------
428 #
429 # sonic# show running-configuration | grep "ip ssh"
430 # ip ssh disable-publickey-authentication false
431 # sonic#
432
433 - name: Override SSH configurations
434 dellemc.enterprise_sonic.sonic_ssh:
435 config:
436 server_globals:
437 publickey_authentication: false
438 state: overridden
439
440 # After state:
441 # ------------
442 #
443 # sonic# show running-configuration | grep "ip ssh"
444 # ip ssh disable-publickey-authentication true
445 # sonic#
446
447
448
449 Return Values
450 -------------
451 Common return values are documented `here <https://docs.ansible.com/projects/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
452
453 .. raw:: html
454
455 <table border=0 cellpadding=0 class="documentation-table">
456 <tr>
457 <th colspan="1">Key</th>
458 <th>Returned</th>
459 <th width="100%">Description</th>
460 </tr>
461 <tr>
462 <td colspan="1">
463 <div class="ansibleOptionAnchor" id="return-"></div>
464 <b>after</b>
465 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
466 <div style="font-size: small">
467 <span style="color: purple">dictionary</span>
468 </div>
469 </td>
470 <td>when changed</td>
471 <td>
472 <div>The configuration resulting from module invocation.</div>
473 <br/>
474 <div style="font-size: smaller"><b>Sample:</b></div>
475 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
476 of the parameters above.</div>
477 </td>
478 </tr>
479 <tr>
480 <td colspan="1">
481 <div class="ansibleOptionAnchor" id="return-"></div>
482 <b>after_generated</b>
483 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
484 <div style="font-size: small">
485 <span style="color: purple">dictionary</span>
486 </div>
487 </td>
488 <td>when <code>check_mode</code></td>
489 <td>
490 <div>The configuration that would be generated by module invocation in non-check mode.</div>
491 <br/>
492 <div style="font-size: smaller"><b>Sample:</b></div>
493 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format as the parameters above.</div>
494 </td>
495 </tr>
496 <tr>
497 <td colspan="1">
498 <div class="ansibleOptionAnchor" id="return-"></div>
499 <b>before</b>
500 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
501 <div style="font-size: small">
502 <span style="color: purple">dictionary</span>
503 </div>
504 </td>
505 <td>always</td>
506 <td>
507 <div>The configuration prior to the model invocation.</div>
508 <br/>
509 <div style="font-size: smaller"><b>Sample:</b></div>
510 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format
511 of the parameters above.</div>
512 </td>
513 </tr>
514 <tr>
515 <td colspan="1">
516 <div class="ansibleOptionAnchor" id="return-"></div>
517 <b>commands</b>
518 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
519 <div style="font-size: small">
520 <span style="color: purple">list</span>
521 </div>
522 </td>
523 <td>always</td>
524 <td>
525 <div>The set of commands pushed to the remote device.</div>
526 <br/>
527 <div style="font-size: smaller"><b>Sample:</b></div>
528 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">[&#x27;command 1&#x27;, &#x27;command 2&#x27;, &#x27;command 3&#x27;]</div>
529 </td>
530 </tr>
531 </table>
532 <br/><br/>
533
534
535 Status
536 ------
537
538
539 Authors
540 ~~~~~~~
541
542 - Bhavesh (@bhaveshdell)