aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/doc/src/ssh_app.xml
blob: 1cbbdfcf38d2f69c116fa62012a0ad2c5d583a5a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE appref SYSTEM "appref.dtd">

<appref>
  <header>
    <copyright>
      <year>2012</year><year>2017</year>
      <holder>Ericsson AB. All Rights Reserved.</holder>
    </copyright>
    <legalnotice>
      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at
 
          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
    </legalnotice>

    <title>SSH</title>
    <prepared></prepared>
    <docno></docno>
    <checked></checked>
    <date></date>
    <rev></rev>
    <file>ssh_app.xml</file>
  </header>
  <app>SSH</app>
  <appsummary>The ssh application implements the Secure Shell (SSH) protocol and
  provides an SSH File Transfer Protocol (SFTP) client and server.</appsummary>
  <description>
    <p>The <c>ssh</c> application is an implementation of the SSH protocol in Erlang.
    <c>ssh</c> offers API functions to write customized SSH clients and servers as well as
    making the Erlang shell available over SSH. An SFTP client, <c>ssh_sftp</c>, and server,
    <c>ssh_sftpd</c>, are also included.</p>
  </description>

   <section>
    <title>DEPENDENCIES</title>
    <p>The <c>ssh</c> application uses the applications
    <seealso marker="public_key:public_key">public_key</seealso> and
    <seealso marker="crypto:crypto">crypto</seealso> 
    to handle public keys and encryption. Hence, these
    applications must be loaded for the <c>ssh</c> application to work. In
    an embedded environment this means that they must be started with
    <seealso marker="kernel:application#start/1">application:start/1,2</seealso> before the
    <c>ssh</c> application is started.
    </p>
  </section>

   <section>
    <title>CONFIGURATION</title>

    <p>The <c>ssh</c> application does not have an application-
    specific configuration file, as described in <seealso marker="kernel:application">application(3)</seealso>.
    However, by default it use the following configuration files
    from OpenSSH:</p>
    <list type="bulleted">
      <item><c>known_hosts</c></item>
      <item><c>authorized_keys</c></item>
      <item><c>authorized_keys2</c></item>
      <item><c>id_dsa</c></item>
      <item><c>id_rsa</c></item>
      <item><c>id_ecdsa</c></item>
      <item><c>ssh_host_dsa_key</c></item>
      <item><c>ssh_host_rsa_key</c></item>
      <item><c>ssh_host_ecdsa_key</c></item>
    </list>
      <p>By default, <c>ssh</c> looks for <c>id_dsa</c>, <c>id_rsa</c>,
      <c>id_ecdsa_key</c>,
      <c>known_hosts</c>, and <c>authorized_keys</c> in ~/.ssh,
      and for the host key files in <c>/etc/ssh</c>. These locations can be changed
      by the options <c>user_dir</c> and <c>system_dir</c>.
      </p>
      <p>Public key handling can also be customized through a callback module that
      implements the behaviors
      <seealso marker="ssh_client_key_api">ssh_client_key_api</seealso> and
      <seealso marker="ssh_server_key_api">ssh_server_key_api</seealso>.
      </p>

  </section>
  <section>
    <title>Public Keys</title>
    <p><c>id_dsa</c>, <c>id_rsa</c> and <c>id_ecdsa</c> are the users private key files.
	Notice that the public key is part of the private key so the <c>ssh</c>
	application does not use the <c>id_&lt;*>.pub</c> files. These are
	for the user's convenience when it is needed to convey the user's
	public key.
      </p>
  </section>
 <section>
    <title>Known Hosts</title>
    <p>The <c>known_hosts</c> file contains a list of approved servers and
      their public keys. Once a server is listed, it can be verified
      without user interaction.
     </p>
  </section>
 <section>
    <title>Authorized Keys</title>
    <p>The <c>authorized_key</c> file keeps track of the user's authorized
      public keys. The most common use of this file is to let users
      log in without entering their password, which is supported by the
      Erlang <c>ssh</c> daemon.
      </p>
  </section>
 <section>
    <title>Host Keys</title>
    <p>RSA, DSA and ECDSA host keys are supported and are
       expected to be found in files named <c>ssh_host_rsa_key</c>,
       <c>ssh_host_dsa_key</c> and <c>ssh_host_ecdsa_key</c>.
       </p>
  </section>
  <section>
    <title>ERROR LOGGER AND EVENT HANDLERS</title>
    <p>The <c>ssh</c> application uses the default <seealso marker="kernel:error_logger">OTP error logger</seealso> to log unexpected errors or print information about special events.</p>
  </section>

  <section>
    <marker id="supported"/>
    <title>SUPPORTED SPECIFICATIONS AND STANDARDS</title>
    <p>The supported SSH version is 2.0.</p>
  </section>
  <section>
    <title>Algorithms</title>
    <p>The actual set of algorithms may vary depending on which OpenSSL crypto library that is installed on the machine.
    For the list on a particular installation, use the command
    <seealso marker="ssh:ssh#default_algorithms/0">ssh:default_algorithms/0</seealso>. 
    The user may override the default algorithm configuration both on the server side and the client side.
    See the option <c>preferred_algorithms</c> in the <seealso marker="ssh:ssh#daemon/1">ssh:daemon/1,2,3</seealso> and
    <seealso marker="ssh:ssh#connect/3">ssh:connect/3,4</seealso> functions.
    </p>

    <p>Supported algorithms are:</p>
    <marker id="supported_algos"></marker>
    <taglist>
      <tag>Key exchange algorithms</tag>
      <item>
	<list type="bulleted">
	  <item>ecdh-sha2-nistp256</item>
	  <item>ecdh-sha2-nistp384</item>
	  <item>ecdh-sha2-nistp521</item>
	  <item>diffie-hellman-group-exchange-sha1</item>
	  <item>diffie-hellman-group-exchange-sha256</item>
	  <item>diffie-hellman-group14-sha1</item>
	  <item>diffie-hellman-group14-sha256</item>
	  <item>diffie-hellman-group16-sha512</item>
	  <item>diffie-hellman-group18-sha512</item>
	  <item>(diffie-hellman-group1-sha1, retired: can be enabled with the <c>preferred_algorithms</c> option)</item>
	</list>
      </item>

      <tag>Public key algorithms</tag>
      <item>
	<list type="bulleted">
	  <item>ecdsa-sha2-nistp256</item>
	  <item>ecdsa-sha2-nistp384</item>
	  <item>ecdsa-sha2-nistp521</item>
	  <item>ssh-rsa</item>
	  <item>ssh-dss</item>
	  <item>rsa-sha2-256</item>
	  <item>rsa-sha2-512</item>
	</list>
      </item>

      <tag>MAC algorithms</tag>
      <item>
	<list type="bulleted">
	  <item>hmac-sha2-256</item>
	  <item>hmac-sha2-512</item>
	  <item>hmac-sha1</item>
	</list>
      </item>

      <tag>Encryption algorithms (ciphers)</tag>
      <item>
	<list type="bulleted">
          <item>[email protected]</item>
          <item>[email protected]</item>
	  <item>aes128-ctr</item>
	  <item>aes192-ctr</item>
	  <item>aes256-ctr</item>
	  <item>aes128-cbc</item>
	  <item>3des-cbc</item>
	  <item>(AEAD_AES_128_GCM, not enabled per default)</item>
          <item>(AEAD_AES_256_GCM, not enabled per default)</item>
	</list>
	<p>See the text at the description of <seealso marker="#rfc5647_note">the rfc 5647 further down</seealso>
	for more information regarding AEAD_AES_*_GCM.
	</p>
	<p>Following the internet de-facto standard, the cipher and mac algorithm AEAD_AES_128_GCM is selected when the 
	cipher [email protected] is negotiated. The cipher and mac algorithm AEAD_AES_256_GCM is selected when the
	cipher [email protected] is negotiated.
	</p>
      </item>
	
      <tag>Compression algorithms</tag>
      <item>
	<list type="bulleted">
	  <item>none</item>
	  <item>[email protected]</item>
	  <item>zlib</item>
	</list>
      </item>
    </taglist>
  </section>
  <section>
    <title>Unicode support</title>
    <p>Unicode filenames are supported if the emulator and the underlaying OS support it. See section DESCRIPTION in the
      <seealso marker="kernel:file">file</seealso> manual page in Kernel for information about this subject.
    </p>
    <p>The shell and the cli both support unicode.
    </p>
  </section>

  <section>
    <title>Rfcs</title>
    <p>The following rfc:s are supported:</p>
    <list type="bulleted">
      <item><url href="https://tools.ietf.org/html/rfc4251">RFC 4251</url>, The Secure Shell (SSH) Protocol Architecture.
      <p>Except</p>
      <list type="bulleted">
	<item>9.4.6 Host-Based Authentication</item>
	<item>9.5.2 Proxy Forwarding</item>
	<item>9.5.3 X11 Forwarding</item>
      </list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4252">RFC 4252</url>, The Secure Shell (SSH) Authentication Protocol.
      <p>Except</p>
      <list type="bulleted">
	<item>9. Host-Based Authentication: "hostbased"</item>
      </list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4253">RFC 4253</url>, The Secure Shell (SSH) Transport Layer Protocol.
      <p>Except</p>
      <list type="bulleted">
	<item>8.1.  diffie-hellman-group1-sha1. Disabled by default, can be enabled with the <c>preferred_algorithms</c> option.</item>
      </list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4254">RFC 4254</url>, The Secure Shell (SSH) Connection Protocol.
      <p>Except</p>
      <list type="bulleted">
	<item>6.3. X11 Forwarding</item>
	<item>7. TCP/IP Port Forwarding</item>
      </list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4256">RFC 4256</url>, Generic Message Exchange Authentication for
      the Secure Shell Protocol (SSH).
      <p>Except</p>
      <list type="bulleted">
	<item><c>num-prompts > 1</c></item>
	<item>password changing</item>
	<item>other identification methods than userid-password</item>
	</list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4419">RFC 4419</url>, Diffie-Hellman Group Exchange for
      the Secure Shell (SSH) Transport Layer Protocol.
       <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc4716">RFC 4716</url>, The Secure Shell (SSH) Public Key File Format.
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/rfc5647">RFC 5647</url>, AES Galois Counter Mode for
      the Secure Shell Transport Layer Protocol.
      <p><marker id="rfc5647_note"/>There is an ambiguity in the synchronized selection of cipher and mac algorithm. 
      This is resolved by OpenSSH in the ciphers [email protected] and [email protected] which are implemented.
      If the explicit ciphers and macs AEAD_AES_128_GCM or AEAD_AES_256_GCM are needed, 
      they could be enabled with the option preferred_algorithms.
      </p>
      <warning>
	<p>
	  If the client or the server is not Erlang/OTP, it is the users responsibility to check that 
	  other implementation has the same interpretation of AEAD_AES_*_GCM as the Erlang/OTP SSH before
	  enabling them. The  aes*[email protected] variants are always safe to use since they lack the
	  ambiguity.
	</p>
      </warning>
      <p>The second paragraph in section 5.1 is resolved as:</p>
      <list type="ordered">
	<item>If the negotiated cipher is AEAD_AES_128_GCM, the mac algorithm is set to  AEAD_AES_128_GCM.</item>
	<item>If the negotiated cipher is AEAD_AES_256_GCM, the mac algorithm is set to  AEAD_AES_256_GCM.</item>
	<item>If the mac algorithm is AEAD_AES_128_GCM, the cipher is set to AEAD_AES_128_GCM.</item>
	<item>If the mac algorithm is AEAD_AES_256_GCM, the cipher is set to AEAD_AES_256_GCM.</item>
      </list>
      <p>The first rule that matches when read in order from the top is applied</p>
      </item>
	
      <item><url href="https://tools.ietf.org/html/rfc5656">RFC 5656</url>, Elliptic Curve Algorithm Integration in 
      the Secure Shell Transport Layer.
      <p>Except</p>
      <list type="bulleted">
	<item>5.   ECMQV Key Exchange</item>
	<item>6.4. ECMQV Key Exchange and Verification Method Name</item>
	<item>7.2. ECMQV Message Numbers</item>
	<item>10.2. Recommended Curves</item>
      </list>
      <p/>
      </item>
      
      <item><url href="https://tools.ietf.org/html/rfc6668">RFC 6668</url>, SHA-2 Data Integrity Verification for
      the Secure Shell (SSH) Transport Layer Protocol
      <p>Comment: Defines hmac-sha2-256 and hmac-sha2-512
      </p>
      </item>

      <item><url href="https://tools.ietf.org/html/draft-ietf-curdle-ssh-kex-sha2">Draft-ietf-curdle-ssh-kex-sha2 (work in progress)</url>, Key Exchange (KEX) Method Updates and Recommendations for Secure Shell (SSH).
      <p>Deviations:</p>
      <list type="bulleted">
	<item>The <c>diffie-hellman-group1-sha1</c> is not enabled by default, but is still supported and can be enabled
	with the option <c>preferred-algorithms</c></item>
	<item>The questionable sha1-based algorithms <c>diffie-hellman-group-exchange-sha1</c> and
	<c>diffie-hellman-group14-sha1</c> are still enabled by default for compatibility with ancient clients and servers.
	They can be disabled with the option <c>preferred-algorithms</c></item>
      </list>
      <p/>
      </item>

      <item><url href="https://tools.ietf.org/html/draft-ietf-curdle-rsa-sha2">Draft-ietf-curdle-rsa-sha2 (work in progress)</url>, Use of RSA Keys with SHA-2 256 and 512 in Secure Shell (SSH).
      </item>
      
      <item><url href="https://tools.ietf.org/html/draft-ietf-curdle-ssh-ext-info">Draft-ietf-curdle-ssh-ext-info (work in progress)</url>, Extension Negotiation in Secure Shell (SSH).
      <p>Implemented are:</p>
      <list type="bulleted">
	<item>The Extension Negotiation Mechanism</item>
	<item>The extension <c>server-sig-algs</c></item>
      </list>
      <p/>
      </item>
      
    </list>

  </section>

  <section>
    <title>SEE ALSO</title>
    <p><seealso marker="kernel:application">application(3)</seealso></p>
  </section>

</appref>