@networkpro/blog 1.0.7 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/CNAME +1 -0
  2. package/LICENSE.md +265 -0
  3. package/MKDOCS.md +20 -0
  4. package/README.md +8 -46
  5. package/assets/consulting-terms.pdf +0 -0
  6. package/assets/license/CC-BY-4.0-rdfa.xml +741 -0
  7. package/assets/license/CC-BY-4.0.xml +25 -0
  8. package/assets/license/COPYING-rdfa.xml +1187 -0
  9. package/assets/license/COPYING.odt +0 -0
  10. package/assets/linksheet.json +8 -0
  11. package/assets/pgp/contact.vcf +13 -0
  12. package/assets/pgp/contact@s.neteng.pro.aexpk +17 -0
  13. package/assets/pgp/contact@s.neteng.pro.asc +17 -0
  14. package/assets/pgp/github@sl.neteng.cc.aexpk +29 -0
  15. package/assets/pgp/github@sl.neteng.cc.asc +29 -0
  16. package/assets/pgp/support@neteng.pro.aexpk +47 -0
  17. package/assets/pgp/support@neteng.pro.asc +47 -0
  18. package/cspell.json +38 -0
  19. package/docs/LICENSE.md +296 -0
  20. package/docs/PRIVACY.md +212 -0
  21. package/docs/README.md +115 -0
  22. package/docs/TERMS-COND.md +277 -0
  23. package/docs/TERMS-USE.md +212 -0
  24. package/docs/license/CC-BY-4.0.html +1235 -0
  25. package/docs/license/CC-BY-4.0.md +367 -0
  26. package/docs/license/CC-BY-4.0.txt +156 -0
  27. package/docs/license/COPYING.html +1413 -0
  28. package/docs/license/COPYING.md +611 -0
  29. package/docs/license/COPYING.txt +232 -0
  30. package/docs_raw/contributing.md +166 -0
  31. package/docs_raw/img/heliboard-promo.png +0 -0
  32. package/docs_raw/img/heliboard.png +0 -0
  33. package/docs_raw/img/msauth-promo.png +0 -0
  34. package/docs_raw/index.md +18 -0
  35. package/docs_raw/posts/betterweb.md +59 -0
  36. package/docs_raw/posts/heliboard.md +50 -0
  37. package/docs_raw/posts/live.md +83 -0
  38. package/docs_raw/posts/moved.md +74 -0
  39. package/docs_raw/posts/msauth.md +51 -0
  40. package/docs_raw/posts/pwa.md +65 -0
  41. package/docs_raw/posts/secure-secure-shell.md +562 -0
  42. package/docs_raw/posts/weblive.md +63 -0
  43. package/docs_raw/sitemap.xml +83 -0
  44. package/{styles → docs_raw/styles}/default.css +6 -42
  45. package/{styles → docs_raw/styles}/normalize.css +5 -2
  46. package/{styles → docs_raw/styles}/style.css +5 -6
  47. package/docs_raw/tags.md +12 -0
  48. package/eslint.config.mjs +80 -0
  49. package/mkdocs.yml +113 -0
  50. package/package.json +10 -9
  51. package/postcss.config.mjs +5 -0
  52. package/ref/README.md +56 -0
  53. package/ref/help.md +17 -0
  54. package/stylelint.config.js +109 -0
  55. package/2015/01/04/secure-secure-shell/index.html +0 -1552
  56. package/2025/04/30/were-live/index.html +0 -1220
  57. package/2025/05/11/the-network-pro-blog-has-moved/index.html +0 -1202
  58. package/2025/05/15/building-a-better-web-experience/index.html +0 -1200
  59. package/2025/05/16/progressive-web-app-is-live/index.html +0 -1232
  60. package/404.html +0 -970
  61. package/archive/2015/index.html +0 -1141
  62. package/archive/2025/index.html +0 -1316
  63. package/assets/external/avatars.githubusercontent.com/u/170266279.png +0 -0
  64. package/assets/external/unpkg.com/mermaid@11/dist/mermaid.min.js +0 -2607
  65. package/assets/images/favicon.png +0 -0
  66. package/assets/javascripts/bundle.13a4f30d.min.js +0 -16
  67. package/assets/javascripts/bundle.13a4f30d.min.js.map +0 -7
  68. package/assets/javascripts/lunr/min/lunr.ar.min.js +0 -1
  69. package/assets/javascripts/lunr/min/lunr.da.min.js +0 -18
  70. package/assets/javascripts/lunr/min/lunr.de.min.js +0 -18
  71. package/assets/javascripts/lunr/min/lunr.du.min.js +0 -18
  72. package/assets/javascripts/lunr/min/lunr.el.min.js +0 -1
  73. package/assets/javascripts/lunr/min/lunr.es.min.js +0 -18
  74. package/assets/javascripts/lunr/min/lunr.fi.min.js +0 -18
  75. package/assets/javascripts/lunr/min/lunr.fr.min.js +0 -18
  76. package/assets/javascripts/lunr/min/lunr.he.min.js +0 -1
  77. package/assets/javascripts/lunr/min/lunr.hi.min.js +0 -1
  78. package/assets/javascripts/lunr/min/lunr.hu.min.js +0 -18
  79. package/assets/javascripts/lunr/min/lunr.hy.min.js +0 -1
  80. package/assets/javascripts/lunr/min/lunr.it.min.js +0 -18
  81. package/assets/javascripts/lunr/min/lunr.ja.min.js +0 -1
  82. package/assets/javascripts/lunr/min/lunr.jp.min.js +0 -1
  83. package/assets/javascripts/lunr/min/lunr.kn.min.js +0 -1
  84. package/assets/javascripts/lunr/min/lunr.ko.min.js +0 -1
  85. package/assets/javascripts/lunr/min/lunr.multi.min.js +0 -1
  86. package/assets/javascripts/lunr/min/lunr.nl.min.js +0 -18
  87. package/assets/javascripts/lunr/min/lunr.no.min.js +0 -18
  88. package/assets/javascripts/lunr/min/lunr.pt.min.js +0 -18
  89. package/assets/javascripts/lunr/min/lunr.ro.min.js +0 -18
  90. package/assets/javascripts/lunr/min/lunr.ru.min.js +0 -18
  91. package/assets/javascripts/lunr/min/lunr.sa.min.js +0 -1
  92. package/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -1
  93. package/assets/javascripts/lunr/min/lunr.sv.min.js +0 -18
  94. package/assets/javascripts/lunr/min/lunr.ta.min.js +0 -1
  95. package/assets/javascripts/lunr/min/lunr.te.min.js +0 -1
  96. package/assets/javascripts/lunr/min/lunr.th.min.js +0 -1
  97. package/assets/javascripts/lunr/min/lunr.tr.min.js +0 -18
  98. package/assets/javascripts/lunr/min/lunr.vi.min.js +0 -1
  99. package/assets/javascripts/lunr/min/lunr.zh.min.js +0 -1
  100. package/assets/javascripts/lunr/tinyseg.js +0 -206
  101. package/assets/javascripts/lunr/wordcut.js +0 -6708
  102. package/assets/javascripts/workers/search.d50fe291.min.js +0 -42
  103. package/assets/javascripts/workers/search.d50fe291.min.js.map +0 -7
  104. package/assets/stylesheets/main.342714a4.min.css +0 -1
  105. package/assets/stylesheets/main.342714a4.min.css.map +0 -1
  106. package/assets/stylesheets/palette.06af60db.min.css +0 -1
  107. package/assets/stylesheets/palette.06af60db.min.css.map +0 -1
  108. package/category/security/index.html +0 -1141
  109. package/contributing/index.html +0 -1306
  110. package/feed_json_created.json +0 -1
  111. package/feed_json_updated.json +0 -1
  112. package/feed_rss_created.xml +0 -1
  113. package/feed_rss_updated.xml +0 -1
  114. package/index.html +0 -1406
  115. package/search/search_index.json +0 -1
  116. package/sitemap.xml +0 -47
  117. package/sitemap.xml.gz +0 -0
  118. package/tags/index.html +0 -1432
  119. /package/assets/{external/raw.githubusercontent.com/netwk-pro/netwk-pro.github.io/refs/heads/master/assets/nsa-happy-dance.png → nsa-happy-dance.png} +0 -0
  120. /package/{ext → docs_raw/ext}/__init__.py +0 -0
  121. /package/{ext → docs_raw/ext}/slugs.py +0 -0
  122. /package/{favicon.ico → docs_raw/favicon.ico} +0 -0
  123. /package/{favicon.svg → docs_raw/favicon.svg} +0 -0
  124. /package/{fontawesome → docs_raw/fontawesome}/LICENSE.txt +0 -0
  125. /package/{fontawesome → docs_raw/fontawesome}/brands/facebook.svg +0 -0
  126. /package/{fontawesome → docs_raw/fontawesome}/brands/instagram.svg +0 -0
  127. /package/{fontawesome → docs_raw/fontawesome}/brands/linkedin.svg +0 -0
  128. /package/{fontawesome → docs_raw/fontawesome}/brands/mastodon.svg +0 -0
  129. /package/{fontawesome → docs_raw/fontawesome}/solid/at.svg +0 -0
  130. /package/{hooks → docs_raw/hooks}/socialmedia.py +0 -0
  131. /package/{icon-180x180.png → docs_raw/icon-180x180.png} +0 -0
  132. /package/{icon-192x192.png → docs_raw/icon-192x192.png} +0 -0
  133. /package/{icon-512x512-maskable.png → docs_raw/icon-512x512-maskable.png} +0 -0
  134. /package/{icon-512x512.png → docs_raw/icon-512x512.png} +0 -0
  135. /package/{icon-splash.png → docs_raw/icon-splash.png} +0 -0
  136. /package/{img → docs_raw/img}/acode.png +0 -0
  137. /package/{img → docs_raw/img}/blog-move.png +0 -0
  138. /package/{img → docs_raw/img}/favicon.png +0 -0
  139. /package/{img → docs_raw/img}/linksheet.png +0 -0
  140. /package/{img → docs_raw/img}/logo.png +0 -0
  141. /package/{img → docs_raw/img}/pmx.png +0 -0
  142. /package/{img → docs_raw/img}/tosdr.png +0 -0
  143. /package/{img → docs_raw/img}/urlcheck.png +0 -0
  144. /package/{manifest.json → docs_raw/manifest.json} +0 -0
  145. /package/{robots.txt → docs_raw/robots.txt} +0 -0
  146. /package/{styles → docs_raw/styles}/global.css +0 -0
@@ -1,1552 +0,0 @@
1
-
2
- <!doctype html>
3
- <html lang="en" class="no-js">
4
- <head>
5
-
6
- <meta charset="utf-8">
7
- <meta name="viewport" content="width=device-width,initial-scale=1">
8
-
9
-
10
-
11
- <link rel="canonical" href="https://blog.netwk.pro/2015/01/04/secure-secure-shell/">
12
-
13
-
14
-
15
- <link rel="next" href="../../../../2025/04/30/were-live/">
16
-
17
-
18
- <link rel="alternate" type="application/rss+xml" title="RSS feed" href="../../../../feed_rss_created.xml">
19
- <link rel="alternate" type="application/rss+xml" title="RSS feed of updated content" href="../../../../feed_rss_updated.xml">
20
-
21
- <link rel="icon" href="/favicon.svg">
22
- <meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.6.14">
23
-
24
-
25
-
26
- <title>Secure Secure Shell - Network Pro™ Blog</title>
27
-
28
-
29
-
30
- <link rel="stylesheet" href="../../../../assets/stylesheets/main.342714a4.min.css">
31
-
32
-
33
- <link rel="stylesheet" href="../../../../assets/stylesheets/palette.06af60db.min.css">
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
- <script>__md_scope=new URL("../../../..",location),__md_hash=e=>[...e].reduce(((e,_)=>(e<<5)-e+_.charCodeAt(0)),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
47
-
48
-
49
-
50
-
51
-
52
-
53
- </head>
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
- <body dir="ltr" data-md-color-scheme="default" data-md-color-primary="amber" data-md-color-accent="yellow">
64
-
65
-
66
- <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
67
- <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
68
- <label class="md-overlay" for="__drawer"></label>
69
- <div data-md-component="skip">
70
-
71
-
72
- <a href="#secure-secure-shell" class="md-skip">
73
- Skip to content
74
- </a>
75
-
76
- </div>
77
- <div data-md-component="announce">
78
-
79
- </div>
80
-
81
-
82
-
83
-
84
- <header class="md-header" data-md-component="header">
85
- <nav class="md-header__inner md-grid" aria-label="Header">
86
- <a href="../../../.." title="Network Pro™ Blog" class="md-header__button md-logo" aria-label="Network Pro™ Blog" data-md-component="logo">
87
-
88
- <img src="/icon-512x512.png" alt="logo">
89
-
90
- </a>
91
- <label class="md-header__button md-icon" for="__drawer">
92
-
93
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"/></svg>
94
- </label>
95
- <div class="md-header__title" data-md-component="header-title">
96
- <div class="md-header__ellipsis">
97
- <div class="md-header__topic">
98
- <span class="md-ellipsis">
99
- Network Pro™ Blog
100
- </span>
101
- </div>
102
- <div class="md-header__topic" data-md-component="header-topic">
103
- <span class="md-ellipsis">
104
-
105
- Secure Secure Shell
106
-
107
- </span>
108
- </div>
109
- </div>
110
- </div>
111
-
112
-
113
- <form class="md-header__option" data-md-component="palette">
114
-
115
-
116
-
117
-
118
- <input class="md-option" data-md-color-media="(prefers-color-scheme)" data-md-color-scheme="default" data-md-color-primary="amber" data-md-color-accent="yellow" aria-label="Switch to light mode" type="radio" name="__palette" id="__palette_0">
119
-
120
- <label class="md-header__button md-icon" title="Switch to light mode" for="__palette_1" hidden>
121
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m14.3 16-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zm-9.15 3.96h2.3L12 9z"/></svg>
122
- </label>
123
-
124
-
125
-
126
-
127
-
128
- <input class="md-option" data-md-color-media="(prefers-color-scheme: dark)" data-md-color-scheme="slate" data-md-color-primary="amber" data-md-color-accent="yellow" aria-label="Switch to system preference" type="radio" name="__palette" id="__palette_1">
129
-
130
- <label class="md-header__button md-icon" title="Switch to system preference" for="__palette_2" hidden>
131
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6a6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
132
- </label>
133
-
134
-
135
-
136
-
137
-
138
- <input class="md-option" data-md-color-media="(prefers-color-scheme: light)" data-md-color-scheme="default" data-md-color-primary="amber" data-md-color-accent="yellow" aria-label="Switch to dark mode" type="radio" name="__palette" id="__palette_2">
139
-
140
- <label class="md-header__button md-icon" title="Switch to dark mode" for="__palette_0" hidden>
141
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a4 4 0 0 0-4 4 4 4 0 0 0 4 4 4 4 0 0 0 4-4 4 4 0 0 0-4-4m0 10a6 6 0 0 1-6-6 6 6 0 0 1 6-6 6 6 0 0 1 6 6 6 6 0 0 1-6 6m8-9.31V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12z"/></svg>
142
- </label>
143
-
144
-
145
- </form>
146
-
147
-
148
-
149
- <script>var palette=__md_get("__palette");if(palette&&palette.color){if("(prefers-color-scheme)"===palette.color.media){var media=matchMedia("(prefers-color-scheme: light)"),input=document.querySelector(media.matches?"[data-md-color-media='(prefers-color-scheme: light)']":"[data-md-color-media='(prefers-color-scheme: dark)']");palette.color.media=input.getAttribute("data-md-color-media"),palette.color.scheme=input.getAttribute("data-md-color-scheme"),palette.color.primary=input.getAttribute("data-md-color-primary"),palette.color.accent=input.getAttribute("data-md-color-accent")}for(var[key,value]of Object.entries(palette.color))document.body.setAttribute("data-md-color-"+key,value)}</script>
150
-
151
-
152
-
153
-
154
-
155
- <label class="md-header__button md-icon" for="__search">
156
-
157
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
158
- </label>
159
- <div class="md-search" data-md-component="search" role="dialog">
160
- <label class="md-search__overlay" for="__search"></label>
161
- <div class="md-search__inner" role="search">
162
- <form class="md-search__form" name="search">
163
- <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
164
- <label class="md-search__icon md-icon" for="__search">
165
-
166
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5"/></svg>
167
-
168
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
169
- </label>
170
- <nav class="md-search__options" aria-label="Search">
171
-
172
- <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
173
-
174
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
175
- </button>
176
- </nav>
177
-
178
- <div class="md-search__suggest" data-md-component="search-suggest"></div>
179
-
180
- </form>
181
- <div class="md-search__output">
182
- <div class="md-search__scrollwrap" tabindex="0" data-md-scrollfix>
183
- <div class="md-search-result" data-md-component="search-result">
184
- <div class="md-search-result__meta">
185
- Initializing search
186
- </div>
187
- <ol class="md-search-result__list" role="presentation"></ol>
188
- </div>
189
- </div>
190
- </div>
191
- </div>
192
- </div>
193
-
194
-
195
-
196
- <div class="md-header__source">
197
- <a href="https://github.com/netwk-pro/netwk-pro.github.io" title="Go to repository" class="md-source" data-md-component="source">
198
- <div class="md-source__icon md-icon">
199
-
200
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
201
- </div>
202
- <div class="md-source__repository">
203
- GitHub
204
- </div>
205
- </a>
206
- </div>
207
-
208
- </nav>
209
-
210
- </header>
211
-
212
- <div class="md-container" data-md-component="container">
213
-
214
-
215
-
216
-
217
-
218
- <nav class="md-tabs" aria-label="Tabs" data-md-component="tabs">
219
- <div class="md-grid">
220
- <ul class="md-tabs__list">
221
-
222
-
223
-
224
-
225
-
226
-
227
-
228
-
229
- <li class="md-tabs__item md-tabs__item--active">
230
- <a href="../../../.." class="md-tabs__link">
231
-
232
-
233
-
234
-
235
-
236
- Home
237
-
238
- </a>
239
- </li>
240
-
241
-
242
-
243
-
244
-
245
-
246
-
247
-
248
-
249
-
250
- <li class="md-tabs__item">
251
- <a href="../../../../contributing/" class="md-tabs__link">
252
-
253
-
254
-
255
-
256
-
257
- Contributing
258
-
259
- </a>
260
- </li>
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
- <li class="md-tabs__item">
273
- <a href="../../../../tags/" class="md-tabs__link">
274
-
275
-
276
-
277
-
278
-
279
- Tags
280
-
281
- </a>
282
- </li>
283
-
284
-
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
- <li class="md-tabs__item">
293
- <a href="https://netwk.pro" class="md-tabs__link">
294
-
295
-
296
-
297
-
298
-
299
- Website
300
-
301
- </a>
302
- </li>
303
-
304
-
305
-
306
-
307
-
308
-
309
-
310
-
311
-
312
-
313
- <li class="md-tabs__item">
314
- <a href="../../../../archive/2025/" class="md-tabs__link">
315
-
316
-
317
-
318
-
319
-
320
- Archive
321
-
322
- </a>
323
- </li>
324
-
325
-
326
-
327
-
328
-
329
-
330
-
331
-
332
-
333
-
334
-
335
- <li class="md-tabs__item">
336
- <a href="../../../../category/security/" class="md-tabs__link">
337
-
338
-
339
-
340
-
341
-
342
- Categories
343
-
344
- </a>
345
- </li>
346
-
347
-
348
-
349
-
350
- </ul>
351
- </div>
352
- </nav>
353
-
354
-
355
-
356
- <main class="md-main" data-md-component="main">
357
- <div class="md-main__inner md-grid">
358
-
359
-
360
-
361
-
362
-
363
- <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" hidden>
364
- <div class="md-sidebar__scrollwrap">
365
- <div class="md-sidebar__inner">
366
-
367
-
368
-
369
-
370
-
371
-
372
- <nav class="md-nav md-nav--primary md-nav--lifted" aria-label="Navigation" data-md-level="0">
373
- <label class="md-nav__title" for="__drawer">
374
- <a href="../../../.." title="Network Pro™ Blog" class="md-nav__button md-logo" aria-label="Network Pro™ Blog" data-md-component="logo">
375
-
376
- <img src="/icon-512x512.png" alt="logo">
377
-
378
- </a>
379
- Network Pro™ Blog
380
- </label>
381
-
382
- <div class="md-nav__source">
383
- <a href="https://github.com/netwk-pro/netwk-pro.github.io" title="Go to repository" class="md-source" data-md-component="source">
384
- <div class="md-source__icon md-icon">
385
-
386
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81"/></svg>
387
- </div>
388
- <div class="md-source__repository">
389
- GitHub
390
- </div>
391
- </a>
392
- </div>
393
-
394
- <ul class="md-nav__list" data-md-scrollfix>
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
-
404
-
405
-
406
- <li class="md-nav__item md-nav__item--active">
407
- <a href="../../../.." class="md-nav__link">
408
-
409
-
410
-
411
- <span class="md-ellipsis">
412
- Home
413
-
414
- </span>
415
-
416
-
417
- </a>
418
- </li>
419
-
420
-
421
-
422
-
423
-
424
-
425
-
426
-
427
-
428
-
429
-
430
-
431
-
432
-
433
-
434
-
435
-
436
-
437
-
438
-
439
-
440
- <li class="md-nav__item md-nav__item--nested">
441
-
442
-
443
-
444
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_2" >
445
-
446
-
447
- <label class="md-nav__link" for="__nav_2" id="__nav_2_label" tabindex="0">
448
-
449
-
450
-
451
- <span class="md-ellipsis">
452
- Contributing
453
-
454
- </span>
455
-
456
-
457
- <span class="md-nav__icon md-icon"></span>
458
- </label>
459
-
460
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_2_label" aria-expanded="false">
461
- <label class="md-nav__title" for="__nav_2">
462
- <span class="md-nav__icon md-icon"></span>
463
- Contributing
464
- </label>
465
- <ul class="md-nav__list" data-md-scrollfix>
466
-
467
-
468
-
469
-
470
-
471
-
472
-
473
- <li class="md-nav__item">
474
- <a href="../../../../contributing/" class="md-nav__link">
475
-
476
-
477
-
478
- <span class="md-ellipsis">
479
- Code of Conduct
480
-
481
- </span>
482
-
483
-
484
- </a>
485
- </li>
486
-
487
-
488
-
489
-
490
- </ul>
491
- </nav>
492
-
493
- </li>
494
-
495
-
496
-
497
-
498
-
499
-
500
-
501
-
502
-
503
-
504
-
505
-
506
-
507
-
508
-
509
-
510
-
511
-
512
-
513
-
514
-
515
- <li class="md-nav__item md-nav__item--nested">
516
-
517
-
518
-
519
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_3" >
520
-
521
-
522
- <label class="md-nav__link" for="__nav_3" id="__nav_3_label" tabindex="0">
523
-
524
-
525
-
526
- <span class="md-ellipsis">
527
- Tags
528
-
529
- </span>
530
-
531
-
532
- <span class="md-nav__icon md-icon"></span>
533
- </label>
534
-
535
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_3_label" aria-expanded="false">
536
- <label class="md-nav__title" for="__nav_3">
537
- <span class="md-nav__icon md-icon"></span>
538
- Tags
539
- </label>
540
- <ul class="md-nav__list" data-md-scrollfix>
541
-
542
-
543
-
544
-
545
-
546
-
547
-
548
- <li class="md-nav__item">
549
- <a href="../../../../tags/" class="md-nav__link">
550
-
551
-
552
-
553
- <span class="md-ellipsis">
554
- Tag Index
555
-
556
- </span>
557
-
558
-
559
- </a>
560
- </li>
561
-
562
-
563
-
564
-
565
- </ul>
566
- </nav>
567
-
568
- </li>
569
-
570
-
571
-
572
-
573
-
574
-
575
-
576
-
577
-
578
- <li class="md-nav__item">
579
- <a href="https://netwk.pro" class="md-nav__link">
580
-
581
-
582
-
583
- <span class="md-ellipsis">
584
- Website
585
-
586
- </span>
587
-
588
-
589
- </a>
590
- </li>
591
-
592
-
593
-
594
-
595
-
596
-
597
-
598
-
599
-
600
-
601
-
602
-
603
-
604
-
605
-
606
-
607
-
608
-
609
-
610
-
611
-
612
-
613
-
614
- <li class="md-nav__item md-nav__item--nested">
615
-
616
-
617
-
618
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_5" >
619
-
620
-
621
- <label class="md-nav__link" for="__nav_5" id="__nav_5_label" tabindex="0">
622
-
623
-
624
-
625
- <span class="md-ellipsis">
626
- Archive
627
-
628
- </span>
629
-
630
-
631
- <span class="md-nav__icon md-icon"></span>
632
- </label>
633
-
634
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_5_label" aria-expanded="false">
635
- <label class="md-nav__title" for="__nav_5">
636
- <span class="md-nav__icon md-icon"></span>
637
- Archive
638
- </label>
639
- <ul class="md-nav__list" data-md-scrollfix>
640
-
641
-
642
-
643
-
644
-
645
-
646
-
647
-
648
-
649
- <li class="md-nav__item">
650
- <a href="../../../../archive/2025/" class="md-nav__link">
651
-
652
-
653
-
654
- <span class="md-ellipsis">
655
- May 2025
656
-
657
- </span>
658
-
659
-
660
- </a>
661
- </li>
662
-
663
-
664
-
665
-
666
-
667
-
668
-
669
-
670
-
671
-
672
-
673
-
674
- <li class="md-nav__item">
675
- <a href="../../../../archive/2015/" class="md-nav__link">
676
-
677
-
678
-
679
- <span class="md-ellipsis">
680
- January 2015
681
-
682
- </span>
683
-
684
-
685
- </a>
686
- </li>
687
-
688
-
689
-
690
-
691
- </ul>
692
- </nav>
693
-
694
- </li>
695
-
696
-
697
-
698
-
699
-
700
-
701
-
702
-
703
-
704
-
705
-
706
-
707
-
708
-
709
-
710
-
711
-
712
-
713
-
714
-
715
-
716
- <li class="md-nav__item md-nav__item--nested">
717
-
718
-
719
-
720
- <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
721
-
722
-
723
- <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
724
-
725
-
726
-
727
- <span class="md-ellipsis">
728
- Categories
729
-
730
- </span>
731
-
732
-
733
- <span class="md-nav__icon md-icon"></span>
734
- </label>
735
-
736
- <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
737
- <label class="md-nav__title" for="__nav_6">
738
- <span class="md-nav__icon md-icon"></span>
739
- Categories
740
- </label>
741
- <ul class="md-nav__list" data-md-scrollfix>
742
-
743
-
744
-
745
-
746
-
747
-
748
-
749
-
750
-
751
- <li class="md-nav__item">
752
- <a href="../../../../category/security/" class="md-nav__link">
753
-
754
-
755
-
756
- <span class="md-ellipsis">
757
- Security
758
-
759
- </span>
760
-
761
-
762
- </a>
763
- </li>
764
-
765
-
766
-
767
-
768
- </ul>
769
- </nav>
770
-
771
- </li>
772
-
773
-
774
-
775
- </ul>
776
- </nav>
777
- </div>
778
- </div>
779
- </div>
780
-
781
-
782
-
783
-
784
-
785
- <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
786
- <div class="md-sidebar__scrollwrap">
787
- <div class="md-sidebar__inner">
788
-
789
-
790
- <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
791
-
792
-
793
-
794
-
795
-
796
-
797
- </nav>
798
- </div>
799
- </div>
800
- </div>
801
-
802
-
803
-
804
- <div class="md-content md-content--post" data-md-component="content">
805
- <div class="md-sidebar md-sidebar--post" data-md-component="sidebar" data-md-type="navigation">
806
- <div class="md-sidebar__scrollwrap">
807
- <div class="md-sidebar__inner md-post">
808
- <nav class="md-nav md-nav--primary">
809
- <div class="md-post__back">
810
- <div class="md-nav__title md-nav__container">
811
- <a href="../../../.." class="md-nav__link">
812
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11z"/></svg>
813
- <span class="md-ellipsis">
814
- Back to index
815
- </span>
816
- </a>
817
- </div>
818
- </div>
819
-
820
- <div class="md-post__authors md-typeset">
821
-
822
- <div class="md-profile md-post__profile">
823
- <span class="md-author md-author--long">
824
- <img src="../../../../assets/external/avatars.githubusercontent.com/u/170266279.png" alt="Network Pro">
825
- </span>
826
- <span class="md-profile__description">
827
- <strong>
828
-
829
- <a href="https://netwk.pro/">Network Pro</a>
830
-
831
- </strong>
832
- <br>
833
- Creator
834
- </span>
835
- </div>
836
-
837
- </div>
838
-
839
- <ul class="md-post__meta md-nav__list">
840
- <li class="md-nav__item md-nav__item--section">
841
- <div class="md-post__title">
842
- <span class="md-ellipsis">
843
- Metadata
844
- </span>
845
- </div>
846
- <nav class="md-nav">
847
- <ul class="md-nav__list">
848
- <li class="md-nav__item">
849
- <div class="md-nav__link">
850
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 19H5V8h14m-3-7v2H8V1H6v2H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-1V1m-1 11h-5v5h5z"/></svg>
851
- <time datetime="2015-01-04 00:00:00+00:00" class="md-ellipsis">January 4, 2015</time>
852
- </div>
853
- </li>
854
-
855
- <li class="md-nav__item">
856
- <div class="md-nav__link">
857
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15 13h1.5v2.82l2.44 1.41-.75 1.3L15 16.69zm4-5H5v11h4.67c-.43-.91-.67-1.93-.67-3a7 7 0 0 1 7-7c1.07 0 2.09.24 3 .67zM5 21a2 2 0 0 1-2-2V5c0-1.11.89-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2v6.1c1.24 1.26 2 2.99 2 4.9a7 7 0 0 1-7 7c-1.91 0-3.64-.76-4.9-2zm11-9.85A4.85 4.85 0 0 0 11.15 16c0 2.68 2.17 4.85 4.85 4.85A4.85 4.85 0 0 0 20.85 16c0-2.68-2.17-4.85-4.85-4.85"/></svg>
858
- <time datetime="2025-05-11 00:00:00+00:00" class="md-ellipsis">May 11, 2025</time>
859
- </div>
860
- </li>
861
-
862
-
863
- <li class="md-nav__item">
864
- <div class="md-nav__link">
865
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9 3v15h3V3zm3 2 4 13 3-1-4-13zM5 5v13h3V5zM3 19v2h18v-2z"/></svg>
866
- <span class="md-ellipsis">
867
- in
868
-
869
- <a href="../../../../category/security/">Security</a></span>
870
- </div>
871
- </li>
872
-
873
-
874
-
875
- <li class="md-nav__item">
876
- <div class="md-nav__link">
877
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 20a8 8 0 0 0 8-8 8 8 0 0 0-8-8 8 8 0 0 0-8 8 8 8 0 0 0 8 8m0-18a10 10 0 0 1 10 10 10 10 0 0 1-10 10C6.47 22 2 17.5 2 12A10 10 0 0 1 12 2m.5 5v5.25l4.5 2.67-.75 1.23L11 13V7z"/></svg>
878
- <span class="md-ellipsis">
879
-
880
- 13 min read
881
-
882
- </span>
883
- </div>
884
- </li>
885
-
886
- </ul>
887
- </nav>
888
- </li>
889
- </ul>
890
-
891
- </nav>
892
-
893
- </div>
894
- </div>
895
- </div>
896
- <article class="md-content__inner md-typeset">
897
-
898
-
899
-
900
-
901
-
902
- <nav class="md-tags" >
903
-
904
-
905
-
906
-
907
- <a href="../../../../tags/#tag:post" class="md-tag">post</a>
908
-
909
-
910
-
911
-
912
-
913
- <a href="../../../../tags/#tag:security" class="md-tag">security</a>
914
-
915
-
916
- </nav>
917
-
918
-
919
-
920
-
921
-
922
-
923
- <h1 id="secure-secure-shell">Secure Secure Shell</h1>
924
- <!-- markdownlint-disable-file -->
925
- <!-- eslint-disable -->
926
-
927
- <blockquote style="font-size: small; font-style: italic; font-weight: bold;">
928
- Originally published on 1/4/2015 by <a rel="noopener noreferrer" href="https://github.com/stribika">stribika</a> at:<br />
929
- <a rel="noopener noreferrer" href="https://blog.stribik.technology/2015/01/04/secure-secure-shell.html">https://blog.stribik.technology/2015/01/04/secure-secure-shell.html</a>
930
- </blockquote>
931
-
932
- <blockquote style="font-size: small; font-style: italic; font-weight: bold;">
933
- Mirrored to preserve information. Minor changes have been made, and this is noted where applicable. Also see:<br />
934
- <a rel="noopener noreferrer" href="https://security.stackexchange.com/questions/143442/what-are-ssh-keygen-best-practices">https://security.stackexchange.com/questions/143442/what-are-ssh-keygen-best-practices</a>
935
- </blockquote>
936
-
937
- <blockquote style="font-size: small;">
938
- 📝 <strong><i>NOTE:</i></strong> Despite this article's age, we've yet to come across a better source of information with regard to SSH configuration.
939
- </blockquote>
940
-
941
- <ul>
942
- <li><a href="#sshd">Skip to the good part.</a></li>
943
- </ul>
944
- <p>You may have heard that the NSA can decrypt SSH at least some of the time.
945
- If you have not, then read the <a href="https://www.spiegel.de/international/germany/inside-the-nsa-s-war-on-internet-security-a-1010361.html&gt;)">latest batch of Snowden documents</a> now. All of it. This post will still be here when you finish. My goal with this post here is to make NSA analysts sad.</p>
946
- <p>TL;DR: Scan this post for fixed width fonts, these will be the config file snippets and commands you have to use.</p>
947
- <!-- more -->
948
-
949
- <p><em>Warning</em>: You will need a recent OpenSSH version.
950
- It should work with 6.5 but I have only tested 6.7 and connections to Github.
951
- Here is a good <a href="http://ssh-comparison.quendi.de/comparison.html">compatibility matrix</a>.</p>
952
- <hr />
953
- <h1 id="the-crypto">The crypto</h1>
954
- <p>Reading the documents, I have the feeling that the NSA can 1) decrypt weak crypto and 2) steal keys.
955
- Let's focus on the crypto first.
956
- SSH supports different key exchange algorithms, ciphers and message authentication codes.
957
- The server and the client choose a set of algorithms supported by both, then proceed with the key exchange.
958
- Some of the supported algorithms are not so great and should be disabled completely.
959
- This hurts interoperability but everyone uses OpenSSH anyway.
960
- Fortunately, downgrade attacks are not possible because the supported algorithm lists are included in the key derivation.
961
- If a man in the middle were to change the lists, then the server and the client would calculate different keys.</p>
962
- <h2 id="key-exchange">Key exchange</h2>
963
- <p>There are basically two ways to do key exchange: <a href="https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">Diffie-Hellman</a> and <a href="https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman">Elliptic Curve Diffie-Hellman</a>.
964
- Both provide <a href="https://en.wikipedia.org/wiki/Forward_secrecy">forward secrecy</a> which the NSA hates because they can't use passive collection and key recovery later.
965
- The server and the client will end up with a shared secret number at the end without a passive eavesdropper learning anything about this number.
966
- After we have a shared secret we have to derive a cryptographic key from this using a key derivation function.
967
- In case of SSH, this is a hash function.
968
- <a href="https://www.mitls.org/downloads/transcript-collisions.pdf">Collision attacks</a> on this hash function have been proven to allow downgrade attacks.</p>
969
- <p>DH works with a multiplicative group of integers modulo a prime.
970
- Its security is based on the hardness of the <a href="https://en.wikipedia.org/wiki/Discrete_logarithm_problem">discrete logarithm problem</a>.</p>
971
- <h2 id="alice-bob"><pre><code id="diffie-hellman">Alice Bob</h2>
972
- <p>Sa = random
973
- Pa = g^Sa --&gt; Pa
974
- Sb = random
975
- Pb &lt;-- Pb = g^Sb
976
- s = Pb^Sa s = Pa^Sb
977
- k = KDF(s) k = KDF(s)</code></pre></p>
978
- <p>ECDH works with elliptic curves over finite fields.
979
- Its security is based on the hardness of the elliptic curve discrete logarithm problem.</p>
980
- <h2 id="alice-bob_1"><pre><code id="elliptic-curve-diffie-hellman">Alice Bob</h2>
981
- <p>Sa = random
982
- Pa = Sa <em>G --&gt; Pa
983
- Sb = random
984
- Pb &lt;-- Pb = Sb</em> G
985
- s = Sa <em>Pb s = Sb</em> Pa
986
- k = KDF(s) k = KDF(s)</code></pre></p>
987
- <hr />
988
- <h2 id="sshd-configuration"><a id="sshd">SSHD Configuration</a></h2>
989
- <blockquote>
990
- <p><strong><em>NOTE:</em></strong> Emphasis added, it was not present in the originally published article.<br />
991
- Key exchange <strong>1</strong> (curve25519-sha256) alone is ideal, <strong>8</strong> is also acceptable for interoperability.</p>
992
- </blockquote>
993
- <p>OpenSSH supports 11 key exchange protocols:</p>
994
- <ol>
995
- <li><strong><a href="https://git.libssh.org/projects/libssh.git/tree/doc/curve25519-sha256@libssh.org.txt">curve25519-sha256</a>: ECDH over <a href="https://cr.yp.to/ecdh.html">Curve25519</a> with SHA2</strong></li>
996
- <li><a href="https://www.ietf.org/rfc/rfc4253.txt">diffie-hellman-group1-sha1</a>: 1024 bit DH with SHA1</li>
997
- <li><a href="https://www.ietf.org/rfc/rfc4253.txt">diffie-hellman-group14-sha1</a>: 2048 bit DH with SHA1</li>
998
- <li><a href="https://tools.ietf.org/html/draft-ietf-curdle-ssh-modp-dh-sha2-09">diffie-hellman-group14-sha256</a>: 2048 bit DH with SHA2</li>
999
- <li><a href="https://tools.ietf.org/html/draft-ietf-curdle-ssh-modp-dh-sha2-09">diffie-hellman-group16-sha512</a>: 4096 bit DH with SHA2</li>
1000
- <li><a href="https://tools.ietf.org/html/draft-ietf-curdle-ssh-modp-dh-sha2-09">diffie-hellman-group18-sha512</a>: 8192 bit DH with SHA2</li>
1001
- <li><a href="https://www.ietf.org/rfc/rfc4419.txt">diffie-hellman-group-exchange-sha1</a>: Custom DH with SHA1</li>
1002
- <li><strong><em><a href="https://www.ietf.org/rfc/rfc4419.txt">diffie-hellman-group-exchange-sha256</a>: Custom DH with SHA2</em></strong></li>
1003
- <li>ecdh-sha2-nistp256: ECDH over NIST P-256 with SHA2</li>
1004
- <li>ecdh-sha2-nistp384: ECDH over NIST P-384 with SHA2</li>
1005
- <li>ecdh-sha2-nistp521: ECDH over NIST P-521 with SHA2</li>
1006
- </ol>
1007
- <p>We have to look at 3 things here:</p>
1008
- <ul>
1009
- <li><em>ECDH curve choice</em>:
1010
- This eliminates <strong>9-11</strong> because <a href="https://blog.cr.yp.to/20140323-ecdsa.html">NIST curves suck</a>.
1011
- They leak secrets through timing side channels and off-curve inputs.
1012
- Also, <a href="https://projectbullrun.org/dual-ec/vulnerability.html">NIST is considered harmful</a> and cannot be trusted.</li>
1013
- <li><em>Bit size of the DH modulus</em>:
1014
- This eliminates <strong>2</strong> because the NSA has supercomputers and possibly unknown attacks.
1015
- 1024 bits simply don't offer sufficient security margin.</li>
1016
- <li><em>Security of the hash function</em>:
1017
- This eliminates <strong>2</strong>, <strong>3</strong>, and <strong>7</strong> because SHA1 is broken.
1018
- We don't have to wait for a second preimage attack that takes 10 minutes on a cellphone to disable it right now.</li>
1019
- </ul>
1020
- <p>We are left with <strong>1</strong> and <strong>8</strong>, as well as <strong>4-6</strong> which were added in <a href="https://www.openssh.com/releasenotes.html#7.3">OpenSSH 7.3</a>.
1021
- <strong>1</strong> is better and it's perfectly OK to only support that but for interoperability (with Eclipse, WinSCP), <strong>8</strong> can be included.</p>
1022
- <blockquote>
1023
- <p><strong><em>NOTE:</em></strong> 8 should no longer be necessary in newer versions of WinSCP. If in doubt, test with only 1 first. Add 8 if it won't connect otherwise.</p>
1024
- </blockquote>
1025
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1026
- <pre><code id="server-kex">KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256</code></pre>
1027
-
1028
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1029
- <pre><code id="client-kex"># Github needs diffie-hellman-group-exchange-sha1 some of the time but not always.
1030
- #Host github.com
1031
- # KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1
1032
-
1033
- Host *
1034
- KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256</code></pre>
1035
-
1036
- <blockquote>
1037
- <p><strong><em>NOTE:</em></strong> GitHub should no longer need a separate setting, as they've transitioned away from SSH keys. They should not require an exception regardless.</p>
1038
- </blockquote>
1039
- <p>If you chose to enable <strong>8</strong>, open <code>/etc/ssh/moduli</code> if exists, and delete lines where the 5th column is less than 2000.</p>
1040
- <pre><code id="server-moduli-filter">awk '$5 > 2000' /etc/ssh/moduli > "${HOME}/moduli"
1041
- wc -l "${HOME}/moduli" # make sure there is something left
1042
- mv "${HOME}/moduli" /etc/ssh/moduli</code></pre>
1043
-
1044
- <p>If it does not exist, create it:</p>
1045
- <pre><code id="server-moduli">ssh-keygen -G /etc/ssh/moduli.all -b 4096
1046
- ssh-keygen -T /etc/ssh/moduli.safe -f /etc/ssh/moduli.all
1047
- mv /etc/ssh/moduli.safe /etc/ssh/moduli
1048
- rm /etc/ssh/moduli.all</code></pre>
1049
-
1050
- <p>This will take a while so continue while it's running.</p>
1051
- <hr />
1052
- <h2 id="authentication">Authentication</h2>
1053
- <p>The key exchange ensures that the server and the client shares a secret no one else knows.
1054
- We also have to make sure that they share this secret with each other and not an NSA analyst.</p>
1055
- <h3 id="server-authentication">Server authentication</h3>
1056
- <p>The server proves its identity to the client by signing the key resulting from the key exchange.
1057
- There are 4 public key algorithms for authentication:</p>
1058
- <ol>
1059
- <li>DSA with SHA1</li>
1060
- <li>ECDSA with SHA256, SHA384 or SHA512 depending on key size</li>
1061
- <li><a href="https://ed25519.cr.yp.to/">Ed25519</a> with SHA512</li>
1062
- <li>RSA with SHA1</li>
1063
- </ol>
1064
- <p>DSA keys must be exactly 1024 bits so let's disable that.
1065
- Number 2 here involves NIST suckage and should be disabled as well.
1066
- Another important disadvantage of DSA and ECDSA is that it uses randomness for each signature.
1067
- If the random numbers are not the best quality, then it is <a href="https://security.stackexchange.com/a/46781">possible to recover</a> the <a href="https://events.ccc.de/congress/2010/Fahrplan/attachments/1780%5F27c3%5Fconsole%5Fhacking%5F2010.pdf">secret key</a>.
1068
- Fortunately, RSA using SHA1 is not a problem here because the value being signed is actually a SHA2 hash.
1069
- The hash function SHA1(SHA2(x)) is just as secure as SHA2 (it has less bits of course but no better attacks).</p>
1070
- <pre><code id="server-auth">Protocol 2
1071
- HostKey /etc/ssh/ssh_host_ed25519_key
1072
- HostKey /etc/ssh/ssh_host_rsa_key</code></pre>
1073
-
1074
- <p>The first time you connect to your server, you will be asked to accept the new fingerprint.</p>
1075
- <p>This will also disable the horribly broken v1 protocol that you should not have enabled in the first place.
1076
- We should remove the unused keys and only generate a large RSA key and an Ed25519 key.
1077
- Your init scripts may recreate the unused keys.
1078
- If you don't want that, remove any <code>ssh-keygen</code> commands from the init script.</p>
1079
- <pre><code id="server-keygen">cd /etc/ssh
1080
- rm ssh_host_*key*
1081
- ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N "" < /dev/null
1082
- ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key -N "" < /dev/null</code></pre>
1083
-
1084
- <h3 id="client-authentication">Client authentication</h3>
1085
- <p>The client must prove its identity to the server as well.
1086
- There are various methods to do that.</p>
1087
- <p>The simplest is password authentication.
1088
- This should be disabled immediately <em>after</em> setting up a more secure method because it allows compromised servers to steal passwords.
1089
- Password authentication is also more vulnerable to online bruteforce attacks.</p>
1090
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1091
- <pre><code id="server-auth-password">PasswordAuthentication no
1092
- ChallengeResponseAuthentication no</code></pre>
1093
-
1094
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1095
- <pre><code id="client-auth-password">Host *
1096
- PasswordAuthentication no
1097
- ChallengeResponseAuthentication no</code></pre>
1098
-
1099
- <p>The most common and secure method is public key authentication, basically the same process as the server authentication.</p>
1100
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1101
- <pre><code id="server-auth-pubkey">PubkeyAuthentication yes</code></pre>
1102
-
1103
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1104
- <pre><code id="client-auth-pubkey">Host *
1105
- PubkeyAuthentication yes
1106
- HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,ssh-rsa</code></pre>
1107
-
1108
- <p>Generate client keys using the following commands:</p>
1109
- <pre><code id="client-keygen">ssh-keygen -t ed25519 -o -a 100
1110
- ssh-keygen -t rsa -b 4096 -o -a 100</code></pre>
1111
-
1112
- <p>You can deploy your new client public keys using <code>ssh-copy-id</code>.</p>
1113
- <p>It is also possible to use OTP authentication to reduce the consequences of lost passwords.
1114
- <a href="https://github.com/google/google-authenticator/wiki/PAM-Module-Instructions">Google Authenticator</a> is a nice implementation of <a href="https://en.wikipedia.org/wiki/Time-based_One-time_Password_Algorithm">TOTP</a>, or Timebased One Time Password.
1115
- You can also use a <a href="https://www.cl.cam.ac.uk/~mgk25/otpw.html">printed list of one time passwords</a> or any other <a href="https://en.wikipedia.org/wiki/Pluggable_authentication_module">PAM</a> module, really, if you enable <code>ChallengeResponseAuthentication</code>.</p>
1116
- <h3 id="user-authentication">User Authentication</h3>
1117
- <p>Even with Public Key authentication, you should only allow incoming connections from expected users. The <code>AllowUsers</code> setting in <code>sshd_config</code> lets you specify users who are allowed to connect, but this can get complicated with a large number of ssh users. Additionally, when deleting a user from the system, the username is <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779880">not removed</a> from <code>sshd_config</code>, which adds to maintenance requirements. The solution is to use the <code>AllowGroups</code> setting instead, and add users to an <code>ssh-user</code> group.</p>
1118
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1119
- <pre><code id="client-auth-allowgroups">AllowGroups ssh-user</code></pre>
1120
-
1121
- <p>Create the ssh-user group with <code>sudo groupadd ssh-user</code>, then add each ssh user to the group with <code>sudo usermod -a -G ssh-user &lt;username&gt;</code>.</p>
1122
- <hr />
1123
- <h2 id="symmetric-ciphers">Symmetric ciphers</h2>
1124
- <blockquote>
1125
- <p><strong><em>NOTE:</em></strong> Emphasis added.</p>
1126
- </blockquote>
1127
- <p>Symmetric ciphers are used to encrypt the data after the initial key exchange and authentication is complete.</p>
1128
- <p>Here we have quite a few algorithms (10-14 were removed in <a href="https://www.openssh.com/releasenotes.html#7.6">OpenSSH 7.6</a>):</p>
1129
- <ol>
1130
- <li>3des-cbc</li>
1131
- <li>aes128-cbc</li>
1132
- <li>aes192-cbc</li>
1133
- <li>aes256-cbc</li>
1134
- <li>aes128-ctr</li>
1135
- <li>aes192-ctr</li>
1136
- <li>aes256-ctr</li>
1137
- <li><strong><em><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#97;&#101;&#115;&#49;&#50;&#56;&#45;&#103;&#99;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#97;&#101;&#115;&#49;&#50;&#56;&#45;&#103;&#99;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></em></strong></li>
1138
- <li><strong><em><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#97;&#101;&#115;&#50;&#53;&#54;&#45;&#103;&#99;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#97;&#101;&#115;&#50;&#53;&#54;&#45;&#103;&#99;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></em></strong></li>
1139
- <li>arcfour</li>
1140
- <li>arcfour128</li>
1141
- <li>arcfour256</li>
1142
- <li>blowfish-cbc</li>
1143
- <li>cast128-cbc</li>
1144
- <li><strong><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#99;&#104;&#97;&#99;&#104;&#97;&#50;&#48;&#45;&#112;&#111;&#108;&#121;&#49;&#51;&#48;&#53;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#99;&#104;&#97;&#99;&#104;&#97;&#50;&#48;&#45;&#112;&#111;&#108;&#121;&#49;&#51;&#48;&#53;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></strong></li>
1145
- </ol>
1146
- <p>We have to consider the following:</p>
1147
- <ul>
1148
- <li><em>Security of the cipher algorithm</em>:
1149
- This eliminates <strong>1</strong> and <strong>10-12</strong> - both DES and RC4 are broken.
1150
- Again, no need to wait for them to become even weaker, disable them now.</li>
1151
- <li><em>Key size</em>:
1152
- At least 128 bits, the more the better.</li>
1153
- <li><em>Block size</em>:
1154
- Does not apply to stream ciphers.
1155
- At least 128 bits.
1156
- This eliminates <strong>13</strong> and <strong>14</strong> because those have a 64 bit block size.</li>
1157
- <li><em>Cipher mode</em>:
1158
- The recommended approach here is to prefer <a href="https://en.wikipedia.org/wiki/Authenticated_encryption">AE</a> modes and optionally allow CTR for compatibility.
1159
- CTR with Encrypt-then-MAC is provably secure.</li>
1160
- </ul>
1161
- <p>Chacha20-poly1305 is preferred over AES-GCM because the SSH protocol <a href="http://blog.djm.net.au/2013/11/chacha20-and-poly1305-in-openssh.html">does not encrypt message sizes</a> when GCM (or EtM) is in use.
1162
- This allows some traffic analysis even without decrypting the data.
1163
- We will deal with that soon.</p>
1164
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1165
- <pre><code id="server-ciphers">Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr</code></pre>
1166
-
1167
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1168
- <pre><code id="client-ciphers">Host *
1169
- Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr</code></pre>
1170
-
1171
- <hr />
1172
- <h2 id="message-authentication-codes">Message authentication codes</h2>
1173
- <blockquote>
1174
- <p>Emphasis added.</p>
1175
- </blockquote>
1176
- <p>Encryption provides <em>confidentiality</em>, message authentication code provides <em>integrity</em>.
1177
- We need both.
1178
- If an AE cipher mode is selected, then extra MACs are not used, the integrity is already given.
1179
- If CTR is selected, then we need a MAC to calculate and attach a tag to every message.</p>
1180
- <p>There are multiple ways to combine ciphers and MACs - not all of these are useful.
1181
- The 3 most common:</p>
1182
- <ul>
1183
- <li><em>Encrypt-then-MAC</em>: encrypt the message, then attach the MAC of the ciphertext.</li>
1184
- <li><em>MAC-then-encrypt</em>: attach the MAC of the plaintext, then encrypt everything.</li>
1185
- <li><em>Encrypt-and-MAC</em>: encrypt the message, then attach the MAC of the plaintext.</li>
1186
- </ul>
1187
- <p>Only Encrypt-then-MAC should be used, period.
1188
- Using MAC-then-encrypt have lead to many attacks on TLS while Encrypt-and-MAC have lead to not quite that many attacks on SSH.
1189
- The reason for this is that the more you fiddle with an attacker provided message, the more chance the attacker has to gain information through side channels.
1190
- In case of Encrypt-then-MAC, the MAC is verified and if incorrect, discarded.
1191
- Boom, one step, no timing channels.
1192
- In case of MAC-then-encrypt, first the attacker provided message has to be decrypted and only then can you verify it.
1193
- Decryption failure (due to invalid CBC padding for example) may take less time than verification failure.
1194
- Encrypt-and-MAC also has to be decrypted first, leading to the same kind of potential side channels.
1195
- It's even worse because no one said that a MAC's output can't leak what its input was.
1196
- SSH by default, uses this method.</p>
1197
- <p>Here are the available MAC choices:</p>
1198
- <ol>
1199
- <li>hmac-md5</li>
1200
- <li>hmac-md5-96</li>
1201
- <li>hmac-sha1</li>
1202
- <li>hmac-sha1-96</li>
1203
- <li>hmac-sha2-256</li>
1204
- <li>hmac-sha2-512</li>
1205
- <li>umac-64</li>
1206
- <li>umac-128</li>
1207
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#109;&#100;&#53;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#109;&#100;&#53;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1208
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#109;&#100;&#53;&#45;&#57;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#109;&#100;&#53;&#45;&#57;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1209
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#49;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#49;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1210
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#49;&#45;&#57;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#49;&#45;&#57;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1211
- <li><strong><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#50;&#45;&#50;&#53;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#50;&#45;&#50;&#53;&#54;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></strong></li>
1212
- <li><strong><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#50;&#45;&#53;&#49;&#50;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#104;&#109;&#97;&#99;&#45;&#115;&#104;&#97;&#50;&#45;&#53;&#49;&#50;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></strong></li>
1213
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#109;&#97;&#99;&#45;&#54;&#52;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#117;&#109;&#97;&#99;&#45;&#54;&#52;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1214
- <li><a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#117;&#109;&#97;&#99;&#45;&#49;&#50;&#56;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;">&#117;&#109;&#97;&#99;&#45;&#49;&#50;&#56;&#45;&#101;&#116;&#109;&#64;&#111;&#112;&#101;&#110;&#115;&#115;&#104;&#46;&#99;&#111;&#109;</a></li>
1215
- </ol>
1216
- <p>The selection considerations:</p>
1217
- <ul>
1218
- <li><em>Security of the hash algorithm</em>:
1219
- No MD5 and SHA1.
1220
- Yes, I know that HMAC-SHA1 does not need collision resistance but why wait?
1221
- Disable weak crypto today.</li>
1222
- <li><em>Encrypt-then-MAC</em>:
1223
- I am not aware of a security proof for CTR-and-HMAC but I also don't think CTR decryption can fail.
1224
- Since there are no downgrade attacks, you can add them to the end of the list.
1225
- You can also do this on a host by host basis so you know which ones are less safe.</li>
1226
- <li><em>Tag size</em>:
1227
- At least 128 bits.
1228
- This eliminates umac-64-etm.</li>
1229
- <li><em>Key size</em>:
1230
- At least 128 bits.
1231
- This doesn't eliminate anything at this point.</li>
1232
- </ul>
1233
- <p>Recommended <code>/etc/ssh/sshd_config</code> snippet:</p>
1234
- <pre><code id="server-macs">MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com</code></pre>
1235
-
1236
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1237
- <pre><code id="client-macs">Host *
1238
- MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com</code></pre>
1239
-
1240
- <h1 id="preventing-key-theft">Preventing key theft</h1>
1241
- <p>Even with forward secrecy the secret keys must be kept secret.
1242
- The NSA has a database of stolen keys - you do not want your key there.</p>
1243
- <hr />
1244
- <h2 id="system-hardening">System hardening</h2>
1245
- <p>OpenSSH has some undocumented, and rarely used features.
1246
- UseRoaming is one such feature with a <a href="https://security.stackexchange.com/questions/110639/how-exploitable-is-the-recent-useroaming-ssh-problem">known vulnerability</a>.</p>
1247
- <p>Recommended <code>/etc/ssh/ssh_config</code> snippet:</p>
1248
- <pre><code id="client-features">Host *
1249
- UseRoaming no</code></pre>
1250
-
1251
- <p>This post is not intended to be a comprehensive system security guide.
1252
- Very briefly:</p>
1253
- <ul>
1254
- <li><em>Don't install what you don't need</em>:
1255
- Every single line of code has a chance of containing a bug.
1256
- Some of these bugs are security holes.
1257
- Fewer lines, fewer holes.</li>
1258
- <li><em>Use free software</em>:
1259
- As in speech.
1260
- You want to use code that's actually reviewed or that you can review yourself.
1261
- There is no way to achieve that without source code.
1262
- Someone may have reviewed proprietary crap but who knows.</li>
1263
- <li><em>Keep your software up to date</em>:
1264
- New versions often fix critical security holes.</li>
1265
- <li><em>Exploit mitigation</em>:
1266
- Sad but true - there will always be security holes in your software.
1267
- There are things you can do to prevent their exploitation, such as GCC's -fstack-protector.
1268
- One of the best security projects out there is <a href="https://grsecurity.net/">Grsecurity</a>.
1269
- Use it or use OpenBSD.</li>
1270
- </ul>
1271
- <hr />
1272
- <h2 id="traffic-analysis-resistance">Traffic analysis resistance</h2>
1273
- <p>Set up <a href="https://www.torproject.org/docs/hidden-services.html.en">Tor hidden services</a> for your SSH servers.
1274
- This has multiple advantages.
1275
- It provides an additional layer of encryption and server authentication.
1276
- People looking at your traffic will not know your IP, so they will be unable to scan and target other services running on the same server and client.
1277
- Attackers can still attack these services but don't know if it has anything to do with the observed traffic until they actually break in.</p>
1278
- <p>Now this is only true if you don't disclose your SSH server's fingerprint in any other way.
1279
- You should only accept connections from the hidden service or from LAN, if required.</p>
1280
- <p>If you don't need LAN access, you can add the following line to <code>/etc/ssh/sshd_config</code>:</p>
1281
- <pre><code id="localhost-only">ListenAddress 127.0.0.1:22</code></pre>
1282
-
1283
- <p>Add this to <code>/etc/tor/torrc</code>:</p>
1284
- <pre><code id="hidden-service">HiddenServiceDir /var/lib/tor/hidden_service/ssh
1285
- HiddenServicePort 22 127.0.0.1:22</code></pre>
1286
-
1287
- <p>You will find the hostname you have to use in <code>/var/lib/tor/hidden_service/ssh/hostname</code>.
1288
- You also have to configure the client to use Tor.
1289
- For this, socat will be needed.
1290
- Add the following line to <code>/etc/ssh/ssh_config</code>:</p>
1291
- <pre><code id="onion-proxy">Host *.onion
1292
- ProxyCommand socat - SOCKS4A:localhost:%h:%p,socksport=9050
1293
-
1294
- Host *
1295
- ...</code></pre>
1296
-
1297
- <p>If you want to allow connections from LAN, don't use the <code>ListenAddress</code> line, configure your firewall instead.</p>
1298
- <hr />
1299
- <h2 id="key-storage">Key storage</h2>
1300
- <p>You should encrypt your client key files using a strong password.
1301
- Additionally, you can use <code>ssh-keygen -o -a $number</code> to slow down cracking attempts by iterating the hash function many times.
1302
- You may want to store them on a pendrive and only plug it in when you want to use SSH.
1303
- Are you more likely to lose your pendrive or have your system compromised?
1304
- I don't know.</p>
1305
- <p>Unfortunately, you can't encrypt your server key and it must be always available, or else sshd won't start.
1306
- The only thing protecting it is OS access controls.</p>
1307
- <hr />
1308
- <h1 id="the-end">The end</h1>
1309
- <p>It's probably a good idea to test the changes.
1310
- <code>ssh -v</code> will print the selected algorithms and also makes problems easier to spot.
1311
- Be extremely careful when configuring SSH on a remote host.
1312
- Always keep an active session, never restart sshd.
1313
- Instead you can send the <code>SIGHUP</code> signal to reload the configuration without killing your session.
1314
- You can be even more careful by starting a new sshd instance on a different port and testing that.</p>
1315
- <p>Can you make these changes?
1316
- If the answer is yes, then...</p>
1317
- <p><img alt="NSA Happy Dance" src="../../../../assets/external/raw.githubusercontent.com/netwk-pro/netwk-pro.github.io/refs/heads/master/assets/nsa-happy-dance.png" title="Happy Dance!!"></p>
1318
- <p>If the answer is no, it's probably due to compatibility problems.
1319
- You can try to convince the other side to upgrade their security and turn it into a yes.
1320
- I have created a <a href="https://github.com/stribika/stribika.github.io/wiki/Secure-Secure-Shell">wiki page</a> where anyone can add config files for preserving compatibility with various SSH implementations and SSH based services.</p>
1321
- <p>If you work for a big company and change management doesn't let you do it, I'm sorry.
1322
- I've seen the v1 protocol enabled in such places.
1323
- There is no chance of improvement.
1324
- Give up to preseve your sanity.</p>
1325
- <p>Special thanks to the people of Twitter for the improvements.</p>
1326
- <hr />
1327
- <h1 id="changelog">ChangeLog</h1>
1328
- <p>You may have noticed that this document changed since last time.
1329
- I want to be very transparent about this.
1330
- There were three major changes:</p>
1331
- <ul>
1332
- <li>After some debate and going back and forth between including GCM or not, it's now back again.
1333
- The reason for dropping it was that SSH doesn't encrypt packet sizes when using GCM.
1334
- The reason for bringing it back is that SSH does the same with any EtM algorithms.
1335
- There is no way around this unless you can live with chacha20-poly1305 only.
1336
- Also, the leaked documents don't sound like they can figure out the lengths or confirm presence of some things, more like straight up "send it to us and we'll decrypt it for you".
1337
- Wrapping SSH in a Tor hidden service will take care of any traffic analysis concerns.</li>
1338
- <li>I'm now allowing Encrypt-and-MAC algorithms with CTR ciphers as a last resort.
1339
- I initially thought it was possible to use downgrade attacks, I now think it is not.</li>
1340
- <li>I briefly disabled RSA because it uses SHA1, this turned out to be a non-issue because we're signing SHA2 hashes.</li>
1341
- </ul>
1342
- <p>You can see the <a href="https://github.com/stribika/stribika.github.io/commits/master/_posts/2015-01-04-secure-secure-shell.md">full list of changes</a> on github.
1343
- I promise not to use <code>git push -f</code>.</p>
1344
- <p>&nbsp;</p>
1345
- <p><strong>Network Pro™</strong> | <em>Cybersecurity that respects your values.</em></p>
1346
- <hr />
1347
- <div style="font-size: 12px; text-align: center;">
1348
-
1349
- <p>Network Pro&trade;, the shield logo, and the "Locking Down Networks&trade;" slogan are <a href="https://netwk.pro/legal#trademark" target="_self">trademarks</a> of Network Pro Strategies.</p>
1350
-
1351
- <p>Licensed under <a href="https://netwk.pro/legal#cc-by" target="_self"><strong>CC BY 4.0</strong></a> and the <a href="https://netwk.pro/legal#gnu-gpl" target="_self"><strong>GNU GPL</strong></a>, as published by the <a rel="noopener noreferrer" href="https://fsf.org" target="_blank">Free Software Foundation</a>, either version 3 of the License, or (at your option) any later version.</p>
1352
-
1353
- </div>
1354
-
1355
-
1356
-
1357
-
1358
-
1359
-
1360
-
1361
-
1362
-
1363
-
1364
-
1365
-
1366
-
1367
-
1368
-
1369
-
1370
-
1371
-
1372
- </article>
1373
- </div>
1374
-
1375
-
1376
- <script>var target=document.getElementById(location.hash.slice(1));target&&target.name&&(target.checked=target.name.startsWith("__tabbed_"))</script>
1377
- </div>
1378
-
1379
- <button type="button" class="md-top md-icon" data-md-component="top" hidden>
1380
-
1381
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8z"/></svg>
1382
- Back to top
1383
- </button>
1384
-
1385
- </main>
1386
-
1387
- <footer class="md-footer">
1388
-
1389
- <div class="md-footer-meta md-typeset">
1390
- <div class="md-footer-meta__inner md-grid">
1391
- <div class="md-copyright">
1392
-
1393
- <div class="md-copyright__highlight">
1394
- Copyright &copy; 2025 Network Pro Strategies (Network Pro&trade;) – <a href="#__consent">Change cookie settings</a>
1395
-
1396
- </div>
1397
-
1398
-
1399
- Made with
1400
- <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
1401
- Material for MkDocs
1402
- </a>
1403
-
1404
- </div>
1405
-
1406
- <div class="md-social">
1407
-
1408
-
1409
-
1410
-
1411
-
1412
- <a href="https://instagram.com/netwk_pro/" target="_blank" rel="noopener" title="Network Pro on Instagram" class="md-social__link">
1413
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141m0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7m146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8m76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8M398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1"/></svg>
1414
- </a>
1415
-
1416
-
1417
-
1418
-
1419
-
1420
- <a href="https://facebook.com/neteng.pro/" target="_blank" rel="noopener" title="Network Pro on Facebook" class="md-social__link">
1421
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M512 256C512 114.6 397.4 0 256 0S0 114.6 0 256c0 120 82.7 220.8 194.2 248.5V334.2h-52.8V256h52.8v-33.7c0-87.1 39.4-127.5 125-127.5 16.2 0 44.2 3.2 55.7 6.4V172c-6-.6-16.5-1-29.6-1-42 0-58.2 15.9-58.2 57.2V256h83.6l-14.4 78.2H287v175.9C413.8 494.8 512 386.9 512 256"/></svg>
1422
- </a>
1423
-
1424
-
1425
-
1426
-
1427
-
1428
- <a href="https://linkedin.com/company/netwk-pro/" target="_blank" rel="noopener" title="Network Pro on LinkedIn" class="md-social__link">
1429
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3M135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5m282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9z"/></svg>
1430
- </a>
1431
-
1432
-
1433
-
1434
-
1435
-
1436
-
1437
-
1438
- <a href="https://noc.social/@neteng_pro/" target="_blank" rel="noopener me" title="Network Pro on Mastoon" class="md-social__link">
1439
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M433 179.11c0-97.2-63.71-125.7-63.71-125.7-62.52-28.7-228.56-28.4-290.48 0 0 0-63.72 28.5-63.72 125.7 0 115.7-6.6 259.4 105.63 289.1 40.51 10.7 75.32 13 103.33 11.4 50.81-2.8 79.32-18.1 79.32-18.1l-1.7-36.9s-36.31 11.4-77.12 10.1c-40.41-1.4-83-4.4-89.63-54a102.5 102.5 0 0 1-.9-13.9c85.63 20.9 158.65 9.1 178.75 6.7 56.12-6.7 105-41.3 111.23-72.9 9.8-49.8 9-121.5 9-121.5m-75.12 125.2h-46.63v-114.2c0-49.7-64-51.6-64 6.9v62.5h-46.33V197c0-58.5-64-56.6-64-6.9v114.2H90.19c0-122.1-5.2-147.9 18.41-175 25.9-28.9 79.82-30.8 103.83 6.1l11.6 19.5 11.6-19.5c24.11-37.1 78.12-34.8 103.83-6.1 23.71 27.3 18.4 53 18.4 175z"/></svg>
1440
- </a>
1441
-
1442
-
1443
-
1444
-
1445
-
1446
- <a href="https://contact.neteng.pro/" target="_blank" rel="noopener" title="Contact Us" class="md-social__link">
1447
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2024 Fonticons, Inc.--><path d="M256 64C150 64 64 150 64 256s86 192 192 192c17.7 0 32 14.3 32 32s-14.3 32-32 32C114.6 512 0 397.4 0 256S114.6 0 256 0s256 114.6 256 256v32c0 53-43 96-96 96-29.3 0-55.6-13.2-73.2-33.9-22.8 21-53.3 33.9-86.8 33.9-70.7 0-128-57.3-128-128s57.3-128 128-128c27.9 0 53.7 8.9 74.7 24.1 5.7-5 13.1-8.1 21.3-8.1 17.7 0 32 14.3 32 32v112c0 17.7 14.3 32 32 32s32-14.3 32-32v-32c0-106-86-192-192-192m64 192a64 64 0 1 0-128 0 64 64 0 1 0 128 0"/></svg>
1448
- </a>
1449
-
1450
- </div>
1451
-
1452
- </div>
1453
- </div>
1454
- </footer>
1455
-
1456
- </div>
1457
- <div class="md-dialog" data-md-component="dialog">
1458
- <div class="md-dialog__inner md-typeset"></div>
1459
- </div>
1460
-
1461
-
1462
- <div class="md-consent" data-md-component="consent" id="__consent" hidden>
1463
- <div class="md-consent__overlay"></div>
1464
- <aside class="md-consent__inner">
1465
- <form class="md-consent__form md-grid md-typeset" name="consent">
1466
-
1467
-
1468
-
1469
-
1470
- <h4>Cookie Consent</h4>
1471
- <p>We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.</p>
1472
- <input class="md-toggle" type="checkbox" id="__settings" >
1473
- <div class="md-consent__settings">
1474
- <ul class="task-list">
1475
-
1476
-
1477
-
1478
-
1479
-
1480
-
1481
-
1482
-
1483
-
1484
-
1485
-
1486
- <li class="task-list-item">
1487
- <label class="task-list-control">
1488
- <input type="checkbox" name="analytics" >
1489
- <span class="task-list-indicator"></span>
1490
- Google Analytics
1491
- </label>
1492
- </li>
1493
-
1494
-
1495
-
1496
-
1497
-
1498
-
1499
-
1500
-
1501
-
1502
-
1503
-
1504
-
1505
- <li class="task-list-item">
1506
- <label class="task-list-control">
1507
- <input type="checkbox" name="github" checked>
1508
- <span class="task-list-indicator"></span>
1509
- GitHub
1510
- </label>
1511
- </li>
1512
-
1513
-
1514
-
1515
- </ul>
1516
- </div>
1517
- <div class="md-consent__controls">
1518
-
1519
-
1520
-
1521
- <button type="reset" class="md-button md-button--primary">Reject</button>
1522
-
1523
-
1524
-
1525
-
1526
- <button class="md-button md-button--primary">Accept</button>
1527
-
1528
-
1529
-
1530
-
1531
-
1532
-
1533
-
1534
- <label class="md-button" for="__settings">Manage settings</label>
1535
-
1536
-
1537
- </div>
1538
- </form>
1539
- </aside>
1540
- </div>
1541
- <script>var consent=__md_get("__consent");if(consent)for(var input of document.forms.consent.elements)input.name&&(input.checked=consent[input.name]||!1);else"file:"!==location.protocol&&setTimeout((function(){document.querySelector("[data-md-component=consent]").hidden=!1}),250);var form=document.forms.consent;for(var action of["submit","reset"])form.addEventListener(action,(function(e){if(e.preventDefault(),"reset"===e.type)for(var n of document.forms.consent.elements)n.name&&(n.checked=!1);__md_set("__consent",Object.fromEntries(Array.from(new FormData(form).keys()).map((function(e){return[e,!0]})))),location.hash="",location.reload()}))</script>
1542
-
1543
-
1544
-
1545
- <script id="__config" type="application/json">{"base": "../../../..", "features": ["navigation.instant", "navigation.tracking", "navigation.tabs", "navigation.indexes", "toc.follow", "navigation.top", "search.suggest"], "search": "../../../../assets/javascripts/workers/search.d50fe291.min.js", "tags": null, "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": null}</script>
1546
-
1547
-
1548
- <script src="../../../../assets/javascripts/bundle.13a4f30d.min.js"></script>
1549
-
1550
-
1551
- </body>
1552
- </html>