summaryrefslogtreecommitdiff
path: root/lib/ssh/doc/src/ssh.xml
blob: d58166711a12c244eebea8d06a5e1e775936665d (plain)
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
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE erlref SYSTEM "erlref.dtd">

<erlref>
  <header>
    <copyright>
      <year>2004</year><year>2022</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>
    <date>2007-10-06</date>
    <rev></rev>
  </header>
  <module since="">ssh</module>
  <modulesummary>Main API of the ssh application</modulesummary>
  <description>
    <p>This is the interface module for the <c>SSH</c> application.
    The Secure Shell (SSH) Protocol is a protocol for secure remote login
    and other secure network services over an insecure network.
    See <seeapp marker="ssh:SSH_app#supported">ssh(6)</seeapp> for details of supported RFCs, versions,
    algorithms and unicode handling.
    </p>
    <p>With the SSH application it is possible to start <i>clients</i> and to start <i>daemons</i> (servers).
    </p>
    <p>Clients are started with
    <seemfa marker="#connect/2">connect/2</seemfa>,
    <seemfa marker="#connect/3">connect/3</seemfa> or
    <seemfa marker="#connect/4">connect/4</seemfa>. They open an encrypted connection on top of TCP/IP.
    In that encrypted connection one or more channels could be opened with
    <seemfa marker="ssh_connection#session_channel/2">ssh_connection:session_channel/2,4</seemfa>.
    </p>
    <p>Each channel is an isolated "pipe" between a client-side process and a server-side process. Those process
    pairs could handle for example file transfers (sftp) or remote command execution (shell, exec and/or cli).
    If a custom shell is implemented, the user of the client could execute the special commands remotely. Note that
    the user is not necessarily a human but probably a system interfacing the SSH app.
    </p>
    <p>A server-side subssystem (channel) server is requested by the client with
    <seemfa marker="ssh_connection#subsystem/4">ssh_connection:subsystem/4</seemfa>.
    </p>
    <p>A server (daemon) is started with
    <seemfa marker="#daemon/2">daemon/1</seemfa>,
    <seemfa marker="#daemon/2">daemon/2</seemfa> or
    <seemfa marker="#daemon/2">daemon/3</seemfa>.
    Possible channel handlers (subsystems) are declared with the
    <seetype marker="#subsystem_daemon_option">subsystem</seetype> option when the daemon is started.
    </p>
    <p>To just run a shell on a remote machine, there are functions that bundles the needed
    three steps needed into one:
    <seemfa marker="#shell/1">shell/1,2,3</seemfa>.
    Similarly, to just open an sftp (file transfer) connection to a remote machine, the simplest way is to use
    <seemfa marker="ssh_sftp#start_channel/1">ssh_sftp:start_channel/1,2,3</seemfa>.
    </p>
    <p>To write your own client channel handler, use the behaviour
    <seeerl marker="ssh_client_channel">ssh_client_channel</seeerl>. For server channel handlers use
    <seeerl marker="ssh_server_channel">ssh_server_channel</seeerl> behaviour (replaces ssh_daemon_channel).
    </p>
    <p>Both clients and daemons accepts options that controls the exact behaviour. Some options are common to both.
    The three sets are called
    <seetype marker="#client_options">Client Options</seetype>,
    <seetype marker="#daemon_options">Daemon Options</seetype> and
    <seetype marker="#common_options">Common Options</seetype>.
    </p>
    <p>The descriptions of the options uses the
    <seeguide marker="system/reference_manual:typespec">Erlang Type Language</seeguide> with explaining text.
    </p>
    <note>
    <p>The <seeguide marker="index">User's Guide</seeguide> has examples and a
    <seeguide marker="using_ssh">Getting Started</seeguide>
    section.
    </p>
    </note>
  </description>

  <section>
    <title>Keys and files</title>
    <p>A number of objects must be present for the SSH application to work.
    Those objects are per default stored in files.
    The default names, paths and file formats are the same as for
    <url href="http://www.openssh.com">OpenSSH</url>. Keys could be generated with the <c>ssh-keygen</c>
    program from OpenSSH. See the
    <seeguide marker="using_ssh#running-an-erlang-ssh-daemon">User's Guide</seeguide>.
    </p>

    <p>The paths could easily be changed by options:
    <seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype> and
    <seetype marker="ssh_file#system_dir_daemon_option"><c>system_dir</c></seetype>.
    </p>
    <p>A completely different storage could be interfaced by writing call-back modules
    using the behaviours
    <seeerl marker="ssh_client_key_api">ssh_client_key_api</seeerl> and/or
    <seeerl marker="ssh_server_key_api">ssh_server_key_api</seeerl>.
    A callback module is installed with the option
    <seetype marker="#key_cb_common_option"><c>key_cb</c></seetype>
    to the client and/or the daemon.
    </p>

    <section>
      <title>Daemons</title>
      <p>The keys are by default stored in files:</p>
      <list>
	<item>Mandatory: one or more <i>Host key(s)</i>, both private and public. Default is to
	store them in the directory <c>/etc/ssh</c> in the files
	<list>
	  <item><c>ssh_host_dsa_key</c> and <c>ssh_host_dsa_key.pub</c></item>
	  <item><c>ssh_host_rsa_key</c> and <c>ssh_host_rsa_key.pub</c></item>
	  <item><c>ssh_host_ecdsa_key</c> and <c>ssh_host_ecdsa_key.pub</c></item>
	</list>
	<p>The host keys directory could be changed with the option
	<seetype marker="ssh_file#system_dir_daemon_option"><c>system_dir</c></seetype>.</p>
	</item>
	<item>Optional: one or more <i>User's public key</i> in case of <c>publickey</c> authorization.
	Default is to store them concatenated in the file <c>.ssh/authorized_keys</c> in the user's home directory.
	<p>The user keys directory could be changed with the option
	<seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype>.</p>
	</item>
      </list>
    </section>

    <section>
      <title>Clients</title>
      <p>The keys and some other data are by default stored in files in the directory <c>.ssh</c>
      in the user's home directory.</p>
      <p>The directory could be changed with the option
      <seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype>.
      </p>
      <list>
	<item>Optional: a list of <i>Host public key(s)</i> for previously connected hosts. This list
	is handled by the SSH application without any need of user assistance. The default
	is to store them in the file <c>known_hosts</c>.
	<p>The
	<seetype marker="#host_accepting_client_options">host_accepting_client_options()</seetype>
	are associated with this list of keys.
	</p>
	</item>
	<item>Optional: one or more <i>User's private key(s)</i> in case of <c>publickey</c> authorization.
	The default files are
	<list>
	  <item><c>id_dsa</c> and <c>id_dsa.pub</c></item>
	  <item><c>id_rsa</c> and <c>id_rsa.pub</c></item>
	  <item><c>id_ecdsa</c> and <c>id_ecdsa.pub</c></item>
	</list>
	</item>
      </list>
    </section>

  </section>

  <!--
      ================================================================
      =  Data types                                                  =
      ================================================================
  -->

  <datatypes>

    <datatype_title>Client Options</datatype_title>

    <datatype>
      <name name="client_options"/>
      <name name="client_option"/>
      <desc>
      <p>Options for <seemfa marker="#connect/3">clients</seemfa>.
      The individual options are further explained below or by following the hyperlinks.
      </p>
      <p>Note that not every
      <seetype marker="kernel:gen_tcp#connect_option">gen_tcp:connect_option()</seetype>
      is accepted. See
      <seemfa marker="ssh#set_sock_opts/2">set_sock_opts/2</seemfa>
      for a list of prohibited options.
      </p>
      <p>Also note that setting a
      <seetype marker="kernel:gen_tcp#connect_option">gen_tcp:connect_option()</seetype>
      could change the socket in a way that impacts the ssh client's behaviour
      negatively. You use it on your own risk.
      </p>
      </desc>
    </datatype>

    <datatype>
      <name name="host_accepting_client_options"/>
      <name name="accept_hosts"/>
      <name name="fp_digest_alg"/>
      <name name="accept_callback"/>
      <name name="fingerprint"/>
      <desc>
	<taglist>
          <tag>
	    <marker id="hardening_client_options--silently_accept_hosts"/>
	    <c>silently_accept_hosts</c>
	  </tag>
	  <item>
            <p>This option guides the <c>connect</c> function on how to act when the connected server presents a Host
            Key that the client has not seen before. The default is to ask the user with a question on stdio of whether to
            accept or reject the new Host Key.
            See the option <seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype>
            for specifying the path to the file <c>known_hosts</c> where previously accepted Host Keys are recorded.
	    See also the option
	    <seetype marker="#key_cb_common_option">key_cb</seetype>
	    for the general way to handle keys.
	    </p>
            <p>The option can be given in three different forms as seen <seetype marker="ssh#accept_hosts">above</seetype>:
	    </p>
	    <list>
	      <item>The value is a <c>boolean()</c>.
	      The value <c>true</c> will make the client accept any unknown Host Key without any user interaction.
	      The value <c>false</c> preserves the default behaviour of asking the user on stdio.
              </item>
              <item>An <c>accept_callback()</c> will be called and the boolean return value <c>true</c>
	      will make the client
              accept the Host Key. A return value of <c>false</c> will make the client to reject the Host Key and as a
              result the connection will be closed. The arguments to the fun are:
              <list type="bulleted">
	        <item><c>PeerName</c> - a string with the name or address of the remote host.</item>
                <item><c>FingerPrint</c> - the fingerprint of the Host Key as
                <seemfa marker="#hostkey_fingerprint/1">hostkey_fingerprint/1</seemfa>
                calculates it.
                </item>
              </list>
              </item>
              <item>A tuple <c>{HashAlgoSpec, accept_callback}</c>. The <c>HashAlgoSpec</c>
	      specifies which hash algorithm
              shall be used to calculate the fingerprint used in the call of the <c>accept_callback()</c>.
	      The <c>HashALgoSpec</c>
              is either an atom or a list of atoms as the first argument in
              <seemfa marker="#hostkey_fingerprint/2">hostkey_fingerprint/2</seemfa>.
              If it is a list of hash algorithm names, the <c>FingerPrint</c> argument in the
	      <c>accept_callback()</c> will be
              a list of fingerprints in the same order as the corresponding name in the <c>HashAlgoSpec</c> list.
              </item>
            </list>
	  </item>
	
	  <tag><c>user_interaction</c></tag>
	  <item>
	    <p>If <c>false</c>, disables the client to connect to the server
	    if any user interaction is needed, such as accepting
	    the server to be added to the <c>known_hosts</c> file, or
	    supplying a password.</p>
	    <p>Even if user interaction is allowed it can be
	    suppressed by other options, such as <c>silently_accept_hosts</c>
	    and <c>password</c>. However, those options are not always desirable
	    to use from a security point of view.</p>
	    <p>Defaults to <c>true</c>.</p>
	  </item>

	  <tag><c>save_accepted_host</c></tag>
	  <item>
	    <p>If <c>true</c>, the client saves an accepted host key to avoid the
	    accept question the next time the same host is connected. If the option
	    <seetype marker="#key_cb_common_option"><c>key_cb</c></seetype>
	    is not present, the key is saved in the file "known_hosts". See option
	    <seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype> for
	    the location of that file.
	    </p>
	    <p>If <c>false</c>, the key is not saved and the key will still be unknown
	    at the next access of the same host.
	    </p>
	    <p>Defaults to <c>true</c></p>
	  </item>

	  <tag><c>quiet_mode</c></tag>
	  <item>
	    <p>If <c>true</c>, the client does not print anything on authorization.</p>
	    <p>Defaults to <c>false</c></p>
	  </item>
	</taglist>
      </desc>
    </datatype>

    <datatype>
      <name name="authentication_client_options"/>
      <desc>
	<taglist>
	  <tag><c>user</c></tag>
          <item>
	    <p>Provides the username. If this option is not given, <c>ssh</c>
	    reads from the environment (<c><![CDATA[LOGNAME]]></c> or
	    <c><![CDATA[USER]]></c> on UNIX,
	    <c><![CDATA[USERNAME]]></c> on Windows).</p>
          </item>

	  <tag><c>password</c></tag>
          <item>
	    <p>Provides a password for password authentication.
	    If this option is not given, the user is asked for a
	    password, if the password authentication method is
	    attempted.</p>
          </item>
	</taglist>
      </desc>
    </datatype>

    <datatype>
      <name name="diffie_hellman_group_exchange_client_option"/>
      <desc>
	<p>Sets the three diffie-hellman-group-exchange parameters that guides the connected server in choosing a group.
	See
	<url href="https://tools.ietf.org/html/rfc4419">RFC 4419</url>
	for the details.  The default value is <c>{1024, 6144, 8192}</c>.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="connect_timeout_client_option"/>
      <desc>
	<p>Sets a timeout on the transport layer connect time.
	For <seeerl marker="kernel:gen_tcp"><c>gen_tcp</c></seeerl> the time is in milli-seconds and the default
	value is <c>infinity</c>.
	</p>
	<p>See the parameter <c>Timeout</c> in <seemfa marker="#connect/4">connect/4</seemfa> for
	a timeout of the negotiation phase.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="recv_ext_info_client_option"/>
      <desc>
	<p>Make the client tell the server that the client accepts extension negotiation, that is,
	include <c>ext-info-c</c> in the kexinit message sent.  See
	<url href="https://tools.ietf.org/html/rfc8308">RFC 8308</url>
	for details and	<seeapp marker="SSH_app#supported-ext-info">ssh(6)</seeapp>
	for a list of currently implemented extensions.
	</p>
	<p>
	  Default value is <c>true</c> which is compatible with other implementations not supporting ext-info.
	</p>
      </desc>
    </datatype>

    <!--................................................................-->
    <datatype_title>Daemon Options (Server Options)</datatype_title>

    <datatype>
      <name name="daemon_options"/>
      <name name="daemon_option"/>
      <desc>
      <p>Options for <seemfa marker="#daemon/1">daemons</seemfa>.
      The individual options are further explained below or by following the hyperlinks.
      </p>
      <p>Note that not every
      <seetype marker="kernel:gen_tcp#listen_option">gen_tcp:listen_option()</seetype>
      is accepted. See
      <seemfa marker="ssh#set_sock_opts/2">set_sock_opts/2</seemfa>
      for a list of prohibited options.
      </p>
      <p>Also note that setting a
      <seetype marker="kernel:gen_tcp#listen_option">gen_tcp:listen_option()</seetype>
      could change the socket in a way that impacts the ssh deamon's behaviour
      negatively. You use it on your own risk.
      </p>
      </desc>
    </datatype>


    <datatype>
      <name name="subsystem_daemon_option"/>
      <name name="subsystem_specs"/>
      <name name="subsystem_spec"/>
      <desc>
	<p>Defines a subsystem in the daemon.</p>
	<p>The <c>subsystem_name</c> is the name that a client requests to start with for example
	<seemfa marker="ssh_connection#subsystem/4">ssh_connection:subsystem/4</seemfa>.
	</p>
	<p>The <c>channel_callback</c> is the module that implements the
	<seeerl marker="ssh_server_channel">ssh_server_channel</seeerl> (replaces ssh_daemon_channel)
	behaviour in the daemon. See the section
	<seeguide marker="using_ssh#usersguide_creating_a_subsystem">Creating a Subsystem</seeguide>
	in the User's Guide for more information and an example.
	</p>
	<p>If the subsystems option is not present, the value of <c>ssh_sftpd:subsystem_spec([])</c> is used.
	This enables the sftp subsystem by default.
	The option can be set to the empty list if you do not want the daemon to run any subsystems.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="shell_daemon_option"/>
      <name name="shell_spec"/>
      <name name="shell_fun"/>
      <name name="'shell_fun/1'"/>
      <name name="'shell_fun/2'"/>
      <desc>
	<p>Defines the read-eval-print loop used in a daemon when a shell is requested by the client.
	The default is to use the Erlang shell: <c><![CDATA[{shell, start, []}]]></c>
	</p>
	<p>See the option <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype>
	for a description of how the daemon executes shell-requests and exec-requests depending on
	the shell- and exec-options.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="exec_daemon_option"/>
      <name name="exec_spec"/>
      <desc/>
    </datatype>
    <datatype>
      <name name="exec_fun"/>
      <desc/>
    </datatype>
    <datatype>
      <name name="'exec_fun/1'"/>
      <name name="'exec_fun/2'"/>
      <name name="'exec_fun/3'"/>
      <desc/>
    </datatype>
    <datatype>
      <name name="exec_result"/>
      <desc>
	<p>This option changes how the daemon executes exec-requests from clients. The term in the return value
	is formatted to a string if it is a non-string type. No trailing newline is added in the ok-case.
	</p>
	<p>See the User's Guide section on
	<seeguide marker="using_ssh#one-time-execution">One-Time Execution</seeguide> for examples.
	</p>
	<p>Error texts are returned on channel-type 1 which usually is piped to <c>stderr</c> on e.g Linux systems.
	Texts from a successful execution  are returned on channel-type 0 and
	will in similar manner be piped to <c>stdout</c>. The exit-status code
	is set to 0 for success and 255 for errors. The exact results presented on the client side depends on the
	client and the client's operating system.
	</p>
	<p>In case of the <c>{direct, exec_fun()}</c> variant or no exec-option at all,
	all reads from <c>standard_input</c> will be from the received data-events of type 0.
	Those are sent by the client. Similarly all writes to <c>standard_output</c>
	will be sent as data-events to the client. An OS shell client like the command 'ssh' will usually use
	stdin and stdout for the user interface.
	</p>
	<p>The option cooperates with the daemon-option <seetype marker="#shell_daemon_option"><c>shell</c></seetype>
	in the following way:</p>
	
	<taglist>
	  <tag>1. If neither the <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype> nor the
	  <seetype marker="#shell_daemon_option"><c>shell-option</c></seetype> is present:</tag>
	  <item>
	    <p>The default Erlang evaluator is used both for exec and shell requests.
	    The result is returned to the client.</p>
	  </item>

	  <tag>2. If the <seetype marker="#exec_daemon_option"><c>exec_spec</c></seetype>'s value is <c>disabled</c>
	  (the <seetype marker="#shell_daemon_option"><c>shell-option</c></seetype> may or may not be present):</tag>
	  <item>
	    <p>No exec-requests are executed but shell-requests are not affected, they follow the
	    <seetype marker="#shell_daemon_option"><c>shell_spec</c></seetype>'s value.</p>
	  </item>

	  <tag>3. If the <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype>
	  is present and the <seetype marker="#exec_daemon_option"><c>exec_spec</c></seetype> value =/= <c>disabled</c>
	  (the <seetype marker="#shell_daemon_option"><c>shell-option</c></seetype> may or may not be present):</tag>
	  <item>
	    <p>The <seetype marker="#exec_daemon_option"><c>exec_spec</c></seetype>
	    <c>fun()</c> is called with the same number of parameters as the arity of the fun,
	    and the result is returned to the client.
	    Shell-requests are not affected, they follow the
	    <seetype marker="#shell_daemon_option"><c>shell_spec</c></seetype>'s value.
	    </p>
	  </item>
	
	  <tag>4. If the <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype> is absent, and the
	  <seetype marker="#shell_daemon_option"><c>shell-option</c></seetype>
	  is present with the default Erlang shell as the
	  <seetype marker="#shell_daemon_option"><c>shell_spec</c></seetype>'s
	  value:</tag>
	  <item>
	    <p>The default Erlang evaluator is used both for exec and shell requests.
	    The result is returned to the client.</p>
	  </item>
	
	  <tag>5. If the <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype> is absent, and the
	  <seetype marker="#shell_daemon_option"><c>shell-option</c></seetype>
	  is present with a value that is neither the default Erlang shell nor the value <c>disabled</c>:</tag>
	  <item>
	    <p>The exec-request is not evaluated and an error message is returned to the client. Shell-requests
	    are executed according to the value of the
	    <seetype marker="#shell_daemon_option"><c>shell_spec</c></seetype>.</p>
	  </item>
	
	  <tag>6. If the <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype> is absent, and the
	  <seetype marker="#shell_daemon_option"><c>shell_spec</c></seetype>'s value is <c>disabled</c>:</tag>
	  <item>
	    <p>Exec requests are executed by the default shell, but shell-requests are not executed.</p>
	  </item>

	</taglist>
	<p>If a custom CLI is installed (see the option
	<seetype marker="#ssh_cli_daemon_option"><c>ssh_cli</c></seetype>)
	the rules above are replaced by thoose implied by the custom CLI.
	</p>
	<note>
	  <p>The <seetype marker="#exec_daemon_option"><c>exec-option</c></seetype>
	  has existed for a long time but has not previously been documented. The old
	  definition and behaviour are retained but obey the rules 1-6 above if conflicting.
	  The old and undocumented style should not be used in new programs.</p>
	</note>
      </desc>
    </datatype>

    <datatype>
      <name name="deprecated_exec_opt"/>
      <desc>
	<p>Old-style exec specification that are kept for compatibility, but should not be used in
	new programs</p>
      </desc>
    </datatype>

    <datatype>
      <name name="ssh_cli_daemon_option"/>
      <desc>
	<p>Provides your own CLI implementation in a daemon.</p>
	<p>It is a channel callback module that implements a shell
	and command execution. The shell's read-eval-print loop can be customized, using the
	option <seetype marker="#shell_daemon_option"><c>shell</c></seetype>. This means less work than implementing
	an own CLI channel. If <c>ssh_cli</c> is set to <c>no_cli</c>, the CLI channels
	like <seetype marker="#shell_daemon_option"><c>shell</c></seetype>
	and <seetype marker="#exec_daemon_option"><c>exec</c></seetype>
	are disabled and only subsystem channels are allowed.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="authentication_daemon_options"/>
      <name name="prompt_texts"/>
      <name name="kb_int_tuple"/>
      <name name="kb_int_fun_3"/>
      <name name="kb_int_fun_4"/>
      <name name="pwdfun_2"/>
      <name name="pwdfun_4"/>
      <desc>
	<taglist>
	  <tag><c>auth_method_kb_interactive_data</c></tag>
	  <item>
	    <p>Sets the text strings that the daemon sends to the client for presentation to the user when
	    using <c>keyboard-interactive</c> authentication.</p>
	    <p>If the fun/3 or fun/4 is used, it is called when the actual authentication occurs and may therefore
	    return dynamic data like time, remote ip etc.</p>
	    <p>The parameter <c>Echo</c> guides the client about need to hide the password.</p>
	    <p>The default value is:
	    <c>{auth_method_kb_interactive_data, {"SSH server", "Enter password for \""++User++"\"", "password: ", false}></c>
	    </p>
          </item>

	  <tag><marker id="option-user_passwords"/><c>user_passwords</c></tag>
	  <item>
            <p>Provides passwords for password authentication. The passwords are used when someone tries
	    to connect to the server and public key user-authentication fails. The option provides
	    a list of valid usernames and the corresponding passwords.
	    </p>
	    <warning>
	      <p>Note that this is very insecure due to the plain-text passwords;
	      it is intended for test purposes.
	      Use the <seeerl marker="#option-pwdfun"><c>pwdfun</c></seeerl> option
	      to handle the password checking instead.
	      </p>
	    </warning>
          </item>

	  <tag><marker id="option-pk_check_user"/><c>pk_check_user</c></tag>
	  <item>
            <p>Enables checking of the
	    <seetype marker="#authentication_client_options">client's user name</seetype>
	    in the server when doing public key authentication. It is disabled by default.
	    </p>
	    <p>The term "user" is used differently in OpenSSH and SSH in Erlang/OTP:
	    see more in the <seeguide marker="terminology#the-term--user-">User's Guide</seeguide>.
	    </p>
	    <p>If the option is enabled, and no
	    <seeerl marker="#option-pwdfun"><c>pwdfun</c></seeerl>
	    is present, the user name must present in the
	    <seeerl marker="#option-user_passwords">user_passwords</seeerl>
	    for the check to succeed but the value of the password is not checked.
	    </p>
	    <p>In case of a <seeerl marker="#option-pwdfun"><c>pwdfun</c></seeerl>
	    checking the user, the atom <c>pubkey</c> is put in the password argument.
	    </p>
          </item>

          <tag><marker id="option-password"/><c>password</c></tag>
          <item>
            <p>Provides a global password that authenticates any user.</p>
	    <warning>
	      <p>Intended to facilitate testing.</p>
	      <p>From a security perspective this option makes the server very vulnerable.</p>
	    </warning>
	  </item>

	  <tag><marker id="option-pwdfun"/><c>pwdfun</c> with
	  <seetype marker="#pwdfun_4"><c>pwdfun_4()</c></seetype>
	  </tag>
	  <item>
	    <p>Provides a function for password validation. This could used for calling an external system or handling
	    passwords stored as hash values.
	    </p>
	    <p>This fun can also be used to make delays in authentication tries for example by calling
	    <seemfa marker="stdlib:timer#sleep/1">timer:sleep/1</seemfa>.</p>
	    <p>To facilitate for instance counting of failed tries,
	    the <c>State</c> variable could be used. This state is per connection only. The first time the pwdfun
	    is called for a connection, the <c>State</c> variable has the value <c>undefined</c>.
	    </p>
	    <p>The fun should return:
	    </p>
	    <list type="bulleted">
	      <item><c>true</c> if the user and password is valid</item>
	      <item><c>false</c> if the user or password is invalid</item>
	      <item><c>disconnect</c> if a SSH_MSG_DISCONNECT message should be sent immediately. It will
	      be followed by a close of the underlying tcp connection.</item>
	      <item><c>{true,  NewState:any()}</c> if the user and password is valid</item>
	      <item><c>{false, NewState:any()}</c> if the user or password is invalid</item>
	    </list>
	    <p>A third usage is to block login attempts from a missbehaving peer. The <c>State</c> described above
	    can be used for this. The return value <c>disconnect</c> is useful for this.</p>
	    <p>In case of the <seeerl marker="#option-pk_check_user"><c>pk_check_user</c></seeerl> is set,
	    the atom <c>pubkey</c> is put in the password argument when validating a public key login. The
	    pwdfun is then responsible to check that the user name is valid.
	    </p>
	  </item>

	  <tag><c>pwdfun</c> with
	  <seetype marker="#pwdfun_2"><c>pwdfun_2()</c></seetype>
	  </tag>
	  <item>
	    <p>Provides a function for password validation. This function is called with user and password
	    as strings, and returns:</p>
	    <list type="bulleted">
	      <item><c>true</c> if the user and password is valid</item>
	      <item><c>false</c> if the user or password is invalid</item>
	    </list>
	    <p>In case of the <seeerl marker="#option-pk_check_user"><c>pk_check_user</c></seeerl> is set,
	    the atom <c>pubkey</c> is put in the password argument when validating a public key login. The
	    pwdfun is then responsible to check that the user name is valid.
	    </p>
	    <p>This variant is kept for compatibility.</p>
	  </item>

	  <tag><marker id="option-no_auth_needed"/><c>no_auth_needed</c></tag>
	  <item>
            <p>If <c>true</c>, a client is authenticated without any need of
	    providing any password or key.
	    </p>
	    <p>This option is only intended for very special applications due
	    to the high risk of accepting any connecting client.
	    </p>
	    <p>The default value is <c>false</c>.
	    </p>
          </item>

	</taglist>
      </desc>
    </datatype>

    <datatype>
      <name name="diffie_hellman_group_exchange_daemon_option"/>
      <name name="explicit_group"/>
      <name name="explicit_group_file"/>
      <name name="ssh_moduli_file"/>
      <desc>
	<taglist>
	  <tag><c>dh_gex_groups</c></tag>
	  <item>
	    <p>Defines the groups the server may choose among when diffie-hellman-group-exchange is negotiated.
	    See
	    <url href="https://tools.ietf.org/html/rfc4419">RFC 4419</url>
	    for details. The three variants of this option are:
	    </p>
	    <taglist>
	      <tag><c>{Size=integer(),G=integer(),P=integer()}</c></tag>
	      <item>The groups are given explicitly in this list. There may be several elements with the same <c>Size</c>.
	      In such a case, the server will choose one randomly in the negotiated Size.
	      </item>
	      <tag><c>{file,filename()}</c></tag>
	      <item>The file must have one or more three-tuples <c>{Size=integer(),G=integer(),P=integer()}</c>
	      terminated by a dot. The file is read when the daemon starts.
	      </item>
	      <tag><c>{ssh_moduli_file,filename()}</c></tag>
	      <item>The file must be in
	      <seemfa marker="public_key:public_key#dh_gex_group/4">ssh-keygen moduli file format</seemfa>.
	      The file is read when the daemon starts.
	      </item>
	    </taglist>
	    <p>The default list is fetched from the
	      <seemfa marker="public_key:public_key#dh_gex_group/4">public_key</seemfa> application.
	    </p>
	  </item>

	  <tag><c>dh_gex_limits</c></tag>
	  <item>
	    <p>Limits what a client can ask for in diffie-hellman-group-exchange.
	    The limits will be
	    <c>{MaxUsed = min(MaxClient,Max), MinUsed = max(MinClient,Min)}</c> where <c>MaxClient</c> and
	    <c>MinClient</c> are the values proposed by a connecting client.
	    </p>
	    <p>The default value is <c>{0,infinity}</c>.
	    </p>
	    <p>If <c>MaxUsed &lt; MinUsed</c> in a key exchange, it will fail with a disconnect.
	    </p>
	    <p>See
	    <url href="https://tools.ietf.org/html/rfc4419">RFC 4419</url>
	    for the function of the Max and Min values.</p>
	  </item>
	</taglist>
      </desc>
    </datatype>

    <datatype>
      <name name="hello_timeout_daemon_option"/>
      <desc>
	<p>Maximum time in milliseconds for the first part of the ssh session setup, the hello message exchange.
	Defaults to 30000 ms (30 seconds). If the client fails to send the first message within this time,
	the connection is closed.
	</p>
	<p>For more information about timeouts, see the
	<seeguide marker="hardening#timeouts">Timeouts section </seeguide>
	in the User's Guide <seeguide marker="hardening">Hardening</seeguide> chapter.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="negotiation_timeout_daemon_option"/>
      <desc>
	<p>Maximum time in milliseconds for the authentication negotiation.
	Defaults to 120000 ms (2 minutes). If the client fails to log in within this time,
	the connection is closed.
	</p>
	<p>For more information about timeouts, see the
	<seeguide marker="hardening#timeouts">Timeouts section </seeguide>
	in the User's Guide <seeguide marker="hardening">Hardening</seeguide> chapter.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="max_initial_idle_time_daemon_option"/>
      <desc>
	<p>Maximum time in milliseconds for the first channel start after
	completion of the authentication negotiation.
	Defaults to <c>infinity</c>.
	</p>
	<p>For more information about timeouts, see the
	<seeguide marker="hardening#timeouts">Timeouts section </seeguide>
	in the User's Guide <seeguide marker="hardening">Hardening</seeguide> chapter.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="hardening_daemon_options"/>
      <desc>
	<p>For more information about hardening, see the
	<seeguide marker="hardening">Hardening</seeguide> section in the User's Guide chapter.
	</p>
	<taglist>
	  <tag>
	    <marker id="hardening_daemon_options--max_sessions"/>
	    <c>max_sessions</c>
	  </tag>
	  <item>
	    <p>The maximum number of simultaneous sessions that are accepted at any time
	    for this daemon. This includes sessions that are being authorized.
	    Thus, if set to <c>N</c>, and <c>N</c> clients have connected but not started
	    the login process, connection attempt <c>N+1</c> is aborted.
	    If <c>N</c> connections are authenticated and still logged in, no more logins
	    are accepted until one of the existing ones log out.
	    </p>
	    <p>The counter is per listening port. Thus, if two daemons are started, one with
	    <c>{max_sessions,N}</c> and the other with <c>{max_sessions,M}</c>, in total
	    <c>N+M</c> connections are accepted for the whole <c>ssh</c> application.
	    </p>
	    <p>Notice that if <c>parallel_login</c> is <c>false</c>, only one client
	    at a time can be in the authentication phase.
	    </p>
	    <p>By default, this option is not set. This means that the number is not limited.
	    </p>
	  </item>
	
	  <tag>
	    <marker id="hardening_daemon_options--max_channels"/>
	    <c>max_channels</c>
	  </tag>
	  <item>
	    <p>The maximum number of channels with active remote subsystem that are accepted for
	    each connection to this daemon</p>
	    <p>By default, this option is not set. This means that the number is not limited.
	    </p>
	  </item>

	  <tag>
	    <marker id="hardening_daemon_options--parallel_login"/>
	    <c>parallel_login</c>
	  </tag>
	  <item>
	    <p>If set to false (the default value), only one login is handled at a time.
	    If set to true, an unlimited number of login attempts are allowed simultaneously.
	    </p>
	    <p>If the <c>max_sessions</c> option is set to <c>N</c> and <c>parallel_login</c>
	    is set to <c>true</c>, the maximum number of simultaneous login attempts at any time is
	    limited to <c>N-K</c>, where <c>K</c> is the number of authenticated connections present
	    at this daemon.
	    </p>
	    <warning>
	      <p>Do not enable <c>parallel_logins</c> without protecting the server by other means,
	      for example, by the <c>max_sessions</c> option or a firewall configuration. If set to
	      <c>true</c>, there is no protection against DOS attacks.</p>
	    </warning>
	  </item>

	  <tag>
	    <marker id="hardening_daemon_options--minimal_remote_max_packet_size"/>
	    <c>minimal_remote_max_packet_size</c>
	  </tag>
	  <item>
	    <p>The least maximum packet size that the daemon will accept in channel open requests from the client.
	    The default value is 0.
	    </p>
	  </item>
	
	</taglist>
      </desc>
    </datatype>

    <datatype>
      <name name="callbacks_daemon_options"/>
      <desc>
	<taglist>
	  <tag><c>connectfun</c></tag>
	  <item>
	    <p>Provides a fun to implement your own logging when a user authenticates to the server.</p>
	  </item>

	  <tag><c>failfun</c></tag>
	  <item>
	    <p>Provides a fun to implement your own logging when a user fails to authenticate.</p>
	  </item>
	</taglist>
      </desc>
    </datatype>

     <datatype>
      <name name="send_ext_info_daemon_option"/>
      <desc>
	<p>Make the server (daemon) tell the client that the server accepts extension negotiation, that is,
	include <c>ext-info-s</c> in the kexinit message sent. See
	<url href="https://tools.ietf.org/html/rfc8308">RFC 8308</url>
	for details and	<seeapp marker="SSH_app#supported-ext-info">ssh(6)</seeapp>
	for a list of currently implemented extensions.
	</p>
	<p>Default value is <c>true</c> which is compatible with other implementations not supporting ext-info.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="tcpip_tunnel_in_daemon_option"/>
      <desc>
	<p>Enables (<c>true</c>) or disables (<c>false</c>) the possibility to tunnel a TCP/IP connection in to a
	<seemfa marker="ssh:ssh#daemon/2">server</seemfa>.
	Disabled per default.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="tcpip_tunnel_out_daemon_option"/>
      <desc>
	<p>Enables (<c>true</c>) or disables (<c>false</c>) the possibility to tunnel a TCP/IP connection out of a
	<seemfa marker="ssh:ssh#daemon/2">server</seemfa>.
	Disabled per default.
	</p>
      </desc>
    </datatype>

    <!--................................................................-->
    <datatype_title>Options common to clients and daemons</datatype_title>
    <datatype>
      <name name="common_options"/>
      <name name="common_option"/>
      <desc><p>The options above can be used both in clients and in daemons (servers). They are further explained below.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="profile_common_option"/>
      <desc>
	<p>Used together with <c>ip-address</c> and <c>port</c> to
	uniquely identify a ssh daemon. This can be useful in a
	virtualized environment, where there can be more that one
	server that has the same <c>ip-address</c> and
	<c>port</c>. If this property is not explicitly set, it is
	assumed that the the <c>ip-address</c> and <c>port</c>
	uniquely identifies the SSH daemon.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="max_idle_time_common_option"/>
      <desc>
	<p>Sets a time-out on a connection when no channels are open. Defaults to <c>infinity</c>.
	The unit is milliseconds.
	</p>
	<p>The timeout is not active until channels are started, so it does
	not limit the time from the connection creation to the first channel opening.
	</p>
	<p>For more information about timeouts, see the
	<seeguide marker="hardening#timeouts">Timeouts section </seeguide>
	in the User's Guide <seeguide marker="hardening">Hardening</seeguide> chapter.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="max_log_item_len_common_option"/>
      <desc>
	<p>Sets a limit for the size of a logged item excluding a header.
	The unit is bytes and the value defaults to 500.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="rekey_limit_common_option"/>
      <name name="limit_bytes"/>
      <name name="limit_time"/>
      <desc>
	<p>Sets the limit when rekeying is to be initiated. Both the max time and max amount of data
	could be configured:
	</p>
	<list>
	  <item><c>{Minutes, Bytes}</c> initiate rekeying when any of the limits are reached.</item>
	  <item><c>Bytes</c> initiate rekeying when <c>Bytes</c> number of bytes are transferred,
	  or at latest after one hour.</item>
	</list>
	<p>When a rekeying is done, both the timer and the byte counter are restarted.
	Defaults to one hour and one GByte.</p>
	<p>If <c>Minutes</c> is set to <c>infinity</c>, no rekeying will ever occur due to that max time has passed.
	Setting <c>Bytes</c> to <c>infinity</c> will inhibit rekeying after a certain amount of data has been transferred.
	If the option value is set to <c>{infinity, infinity}</c>, no rekeying will be initiated. Note that rekeying initiated
	by the peer will still be performed.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="key_cb_common_option"/>
      <desc>
	<p>Module implementing the behaviour
	<seeerl marker="ssh_client_key_api">ssh_client_key_api</seeerl> and/or
	<seeerl marker="ssh_server_key_api">ssh_server_key_api</seeerl>.
	Can be used to
	customize the handling of public keys. If callback options are provided
	along with the module name, they are made available to the callback
	module via the options passed to it under the key 'key_cb_private'.
	</p>
	<p>The <c>Opts</c> defaults to <c>[]</c> when only the <c>Module</c> is specified.
	</p>
	<p>The default value of this option is <c>{ssh_file, []}</c>. See also the manpage of
	<seeerl marker="ssh:ssh_file">ssh_file</seeerl>.
	</p>
	<p>A call to the call-back function <c>F</c> will be</p>
	<code>
	  Module:F(..., [{key_cb_private,Opts}|UserOptions])
	</code>
	<p>where <c>...</c> are arguments to <c>F</c> as in
	<seeerl marker="ssh_client_key_api">ssh_client_key_api</seeerl> and/or
	<seeerl marker="ssh_server_key_api">ssh_server_key_api</seeerl>.
	The <c>UserOptions</c> are the options given to
	<seemfa marker="ssh:ssh#connect/3">ssh:connect</seemfa>,
	<seemfa marker="ssh:ssh#shell/1">ssh:shell</seemfa> or
	<seemfa marker="ssh:ssh#daemon/2">ssh:daemon</seemfa>.
	</p>

      </desc>
    </datatype>

    <datatype>
      <name name="pref_public_key_algs_common_option"/>
      <desc>
        <p>List of user (client) public key algorithms to try to use.</p>
	<p>The default value is the <c>public_key</c> entry in the list returned by
	<seemfa marker="#default_algorithms/0">ssh:default_algorithms/0</seemfa>.
	</p>
	<p>If there is no public key of a specified type available, the corresponding entry is ignored.
	Note that the available set is dependent on the underlying cryptolib and current user's public keys.
	</p>
        <p>See also the option <seetype marker="ssh_file#user_dir_common_option"><c>user_dir</c></seetype>
        for specifying the path to the user's keys.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="disconnectfun_common_option"/>
      <desc>
	<p>Provides a fun to implement your own logging or other handling at disconnects.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="unexpectedfun_common_option"/>
      <desc>
	<p>Provides a fun to implement your own logging or other action when an unexpected message arrives.
	If the fun returns <c>report</c> the usual info report is issued but if <c>skip</c> is returned no
	report is generated.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="ssh_msg_debug_fun_common_option"/>
      <desc>
	<p>Provide a fun to implement your own logging of the SSH message SSH_MSG_DEBUG.
	The last three parameters are from the message, see
	<url href="https://tools.ietf.org/html/rfc4253#section-11.3">RFC 4253, section 11.3</url>.
	The <seetype marker="#connection_ref"><c>connection_ref()</c></seetype> is the reference
	to the connection on which the message arrived.
	The return value from the fun is not checked.
	</p>
	<p>The default behaviour is ignore the message.
	To get a printout for each message with <c>AlwaysDisplay = true</c>,
	use for example <c>{ssh_msg_debug_fun, fun(_,true,M,_)-> io:format("DEBUG: ~p~n", [M]) end}</c></p>
      </desc>
    </datatype>

    <datatype>
      <name name="id_string_common_option"/>
      <desc>
	<p>The string the daemon will present to a connecting peer initially.
	The default value is "Erlang/VSN" where VSN is the ssh application version number.
	</p>
	<p>The value <c>random</c> will cause a random string to be created at each connection attempt.
	This is to make it a bit more difficult for a malicious peer to find the ssh software brand and version.
	</p>
	<p>The value <c>{random, Nmin, Nmax}</c> will make a random string with at least <c>Nmin</c> characters and
	at most <c>Nmax</c> characters.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="preferred_algorithms_common_option"/>
      <name name="algs_list"/>
      <name name="alg_entry"/>
      <name name="kex_alg"/>
      <name name="pubkey_alg"/>
      <name name="cipher_alg"/>
      <name name="mac_alg"/>
      <name name="compression_alg"/>
      <name name="double_algs"/>

      <desc>
	<p>List of algorithms to use in the algorithm negotiation. The default <c>algs_list()</c> can
	be obtained from <seemfa marker="#default_algorithms/0">default_algorithms/0</seemfa>.
	</p>
	<p>If an alg_entry() is missing in the algs_list(), the default value is used for that entry.</p>
	<p>Here is an example of this option:</p>
	<code>
	  {preferred_algorithms,
	  [{public_key,['ssh-rsa','ssh-dss']},
	  {cipher,[{client2server,['aes128-ctr']},
          {server2client,['aes128-cbc','3des-cbc']}]},
	  {mac,['hmac-sha2-256','hmac-sha1']},
	  {compression,[none,zlib]}
	  ]
	  }
	</code>
	<p>The example specifies different algorithms in the two directions (client2server and server2client),
	for cipher but specifies the same algorithms for mac and compression in both directions.
	The kex (key exchange) is implicit but public_key is set explicitly.</p>

	<p>For background and more examples see the <seeguide marker="configure_algos#introduction">User's Guide</seeguide>.</p>

	<p>If an algorithm name occurs more than once in a list, the behaviour is undefined. The tags in the property lists
	are also assumed to occur at most one time.
	</p>

	<warning>
	  <p>Changing the values can make a connection less secure. Do not change unless you
	  know exactly what you are doing. If you do not understand the values then you
	  are not supposed to change them.</p>
	</warning>
      </desc>
    </datatype>

    <datatype>
      <name name="modify_algorithms_common_option"/>
      <name name="modify_algs_list"/>
      <desc>
	<p>Modifies the list of algorithms to use in the algorithm negotiation. The modifications are
	applied after the option <c>preferred_algorithms</c> (if existing) is applied.</p>
	<p>The algorithm for modifications works like this:</p>
	<list>
	  <item>
	    <p>Input is the <c>modify_algs_list()</c> and a set of algorithms <c>A</c>
	    obtained from the <c>preferred_algorithms</c> option if existing, or else from the
	    <seemfa marker="ssh#default_algorithms/0">ssh:default_algorithms/0</seemfa>.
	    </p>
	  </item>
	  <item>
	    <p>The head of the <c>modify_algs_list()</c> modifies <c>A</c> giving the result <c>A'</c>.</p>
	    <p>The possible modifications are:</p>
	    <list>
	      <item>
		<p>Append or prepend supported but not enabled algorithm(s) to the list of
		algorithms. If the wanted algorithms already are in <c>A</c> they will first
		be removed and then appended or prepended,
		</p>
	      </item>
	      <item>
		<p>Remove (rm) one or more algorithms from <c>A</c>.
		</p>
	      </item>
	    </list>
	  </item>
	  <item>
	    <p>Repeat the modification step with the tail of <c>modify_algs_list()</c> and the resulting
	    <c>A'</c>.
	    </p>
	  </item>
	</list>
	<p>If an unsupported algorithm is in the <c>modify_algs_list()</c>, it will be silently ignored</p>
	<p>If there are more than one modify_algorithms options, the result is undefined.</p>
	<p>Here is an example of this option:</p>
	<code>
	  {modify_algorithms,
	  [{prepend, [{kex, ['diffie-hellman-group1-sha1']}],
	  {rm,      [{compression, [none]}]}
	  ]
	  }
	</code>
	<p>The example specifies that:</p>
	<list>
	  <item><p>the old key exchange algorithm 'diffie-hellman-group1-sha1' should be
	  the main alternative. It will be the main alternative since it is prepened to the list</p>
	  </item>
	  <item><p>The compression algorithm none (= no compression) is removed so compression is enforced</p>
	  </item>
	</list>
	<p>For background and more examples see the <seeguide marker="configure_algos#introduction">User's Guide</seeguide>.</p>
      </desc>
    </datatype>


    <datatype>
      <name name="inet_common_option"/>
      <desc>
	<p>IP version to use when the host address is specified as <c>any</c>.</p>
      </desc>
    </datatype>

    <datatype>
      <name name="auth_methods_common_option"/>
      <desc>
	<p>Comma-separated string that determines which authentication methods that the client shall
	support and in which order they are tried. Defaults to <c>"publickey,keyboard-interactive,password"</c>
	</p>
	<p>Note that the client is free to use any order and to exclude methods.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="fd_common_option"/>
      <desc>
	<p>Allows an existing file-descriptor to be used (passed on to the transport protocol).</p>
      </desc>
    </datatype>

    <!--................................................................-->
    <datatype_title>Other data types</datatype_title>

    <datatype>
      <name name="host"/>
      <desc>
      </desc>
    </datatype>

    <datatype>
      <name name="ip_port"/>
      <desc>
      </desc>
    </datatype>

    <datatype>
      <name name="mod_args"/>
      <desc>
      </desc>
    </datatype>

    <datatype>
      <name name="mod_fun_args"/>
      <desc>
      </desc>
    </datatype>

    <datatype>
      <name name="open_socket"/>
      <desc>
	<p>The socket is supposed to be result of a <seemfa marker="kernel:gen_tcp#connect/3">gen_tcp:connect</seemfa>
	or a <seemfa marker="kernel:gen_tcp#accept/1">gen_tcp:accept</seemfa>. The socket must be in passive
	mode (that is, opened with the option <c>{active,false})</c>.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="daemon_ref"/>
      <desc>
	<p>Opaque data type representing a daemon.</p>
	<p>Returned by the functions <seemfa marker="ssh#daemon/1"><c>daemon/1,2,3</c></seemfa>.</p>
      </desc>
    </datatype>

    <datatype>
      <name>connection_ref()</name>
      <desc>
	<p>Opaque data type representing a connection between a client and a server (daemon).</p>
	<p>Returned by the functions
	<seemfa marker="ssh#connect/3"><c>connect/2,3,4</c></seemfa> and
	<seemfa marker="ssh_sftp#start_channel/2"><c>ssh_sftp:start_channel/2,3</c></seemfa>.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="channel_id"/>
      <desc>
	<p>Opaque data type representing a channel inside a connection.</p>
	<p>Returned by the functions
	<seemfa marker="ssh_connection#session_channel/2">ssh_connection:session_channel/2,4</seemfa>.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="connection_info_tuple"/>
      <name name="version"/>
      <name name="protocol_version"/>
      <name name="software_version"/>
      <name name="conn_info_algs"/>
      <name name="conn_info_channels"/>
      <desc>
	<p>Return values from the
	<seemfa marker="#connection_info/1">connection_info/1</seemfa> and
	<seemfa marker="#connection_info/2">connection_info/2</seemfa> functions.
	</p>
	<p>In the <c>option</c> info tuple are only the options included that differs from the default values.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name name="daemon_info_tuple"/>
      <desc>
	<p>Return values from the
	<seemfa marker="#daemon_info/1">daemon_info/1</seemfa> and
	<seemfa marker="#daemon_info/2">daemon_info/2</seemfa> functions.
	</p>
	<p>In the <c>option</c> info tuple are only the options included that differs from the default values.
	</p>
      </desc>
    </datatype>

    <datatype>
      <name>opaque_client_options()</name>
      <name>opaque_daemon_options()</name>
      <name>opaque_common_options()</name>
      <desc>
	<p>Opaque types that define experimental options that are not to be used in products.</p>
      </desc>
    </datatype>
  </datatypes>

<!--
    ================================================================
    =  Function definitions                                        =
    ================================================================
-->

 <funcs>

<!-- CLOSE/1 -->
   <func>
     <name name="close" arity="1" since=""/>
      <fsummary>Closes an SSH connection.</fsummary>
      <desc><p>Closes an SSH connection.</p></desc>
    </func>

<!-- CONNECT/2 etc -->
   <func>
     <name since="">connect(Host, Port, Options) -> Result </name>
     <name since="">connect(Host, Port, Options, NegotiationTimeout) -> Result </name>
     <name since="OTP 19.0">connect(TcpSocket, Options) -> Result</name>
     <name since="">connect(TcpSocket, Options, NegotiationTimeout) -> Result</name>
     <fsummary>Connects to an SSH server.</fsummary>
     <type>
       <v>Host = <seetype marker="#host">host()</seetype></v>
       <v>Port = <seetype marker="kernel:inet#port_number">inet:port_number()</seetype></v>
       <v>Options = <seetype marker="#client_options">client_options()</seetype></v>
       <v>TcpSocket = <seetype marker="#open_socket">open_socket()</seetype></v>
       <v>NegotiationTimeout = timeout()</v>
       <v>Result = {ok, <seetype marker="#connection_ref">connection_ref()</seetype>} | {error, term()}</v>
     </type>
     <desc>
       <p>Connects to an SSH server at the <c>Host</c> on <c>Port</c>.
       </p>
       <p>As an alternative, an already open TCP socket could be passed to the function in <c>TcpSocket</c>.
       The SSH initiation and negotiation will be initiated on that one with the SSH that should be at the
       other end.
       </p>
       <p>No channel is started. This is done by calling <seemfa marker="ssh_connection#session_channel/2">
       ssh_connection:session_channel/[2, 4]</seemfa>.
       </p>
       <p>The <c>NegotiationTimeout</c> is in milli-seconds. The default value is <c>infinity</c> or
       the value of the <seetype marker="#connect_timeout_client_option"><c>connect_timeout</c></seetype>
       option, if present.
       For connection timeout, use the option
       <seetype marker="#connect_timeout_client_option"><c>connect_timeout</c></seetype>.
       </p>
     </desc>
   </func>

<!-- CONNECTION_INFO/1, CONNECTION_INFO/2 -->
   <func>
     <name name="connection_info" arity="1" since="OTP 22.1"/>
     <name name="connection_info" arity="2" since=""/>
     <fsummary>Retrieves information about a connection.</fsummary>
     <desc>
       <p>Returns information about a connection intended for e.g debugging or logging.
       </p>
       <p>When the <c>Key</c> is a single <c>Item</c>, the result is a single <c>InfoTuple</c>
       </p>
    </desc>
   </func>

<!-- SET_SOCK_OPTS/2 -->
   <func>
     <name name="set_sock_opts" arity="2" since="OTP 22.3"/>
     <fsummary>Set tcp socket options on connections</fsummary>
     <desc>
       <p>Sets tcp socket options on the tcp-socket below an ssh connection.</p>
       <p>This function calls the
       <seemfa marker="kernel:inet#setopts/2">inet:setopts/2</seemfa>, read that documentation and
       for <seetype marker="kernel:gen_tcp#option">gen_tcp:option()</seetype>.
       </p>
       <p>
       All gen_tcp socket options except
       </p>
       <list>
	 <item><c>active</c></item>
	 <item><c>deliver</c></item>
	 <item><c>mode</c> and</item>
	 <item><c>packet</c></item>
       </list>
       <p>are allowed. The excluded options are reserved by the SSH application.
       </p>
       <warning>
	 <p>This is an extremely dangerous function. You use it on your own risk.</p>
	 <p>Some options are OS and OS version dependent.
	 Do not use it unless you know what effect your option values will have
	 on an TCP stream.</p>
	 <p>Some values may destroy the functionality of the SSH protocol.
	 </p>
       </warning>
     </desc>
   </func>

<!-- GET_SOCK_OPTS/2 -->
   <func>
     <name name="get_sock_opts" arity="2" since="OTP 22.3"/>
     <fsummary>Get tcp socket options on connections</fsummary>
     <desc>
       <p>Get tcp socket option values of the tcp-socket below an ssh connection.</p>
       <p>This function calls the
       <seemfa marker="kernel:inet#getopts/2">inet:getopts/2</seemfa>, read that documentation.
       </p>
     </desc>
   </func>

<!-- DAEMON/1,2,3 -->
   <func>
     <name since="">daemon(Port | TcpSocket) -> Result</name>
     <name since="">daemon(Port | TcpSocket, Options) -> Result</name>
     <name since="">daemon(HostAddress, Port, Options) -> Result</name>
     <fsummary>Starts a server listening for SSH connections.</fsummary>
     <type>
       <v>Port = integer()</v>
       <v>TcpSocket = <seetype marker="#open_socket">open_socket()</seetype></v>
       <v>Options = <seetype marker="#daemon_options">daemon_options()</seetype></v>
       <v>HostAddress = <seetype marker="#host">host()</seetype> | any</v>
       <v>Result = {ok, <seetype marker="#daemon_ref">daemon_ref()</seetype>} | {error, atom()}</v>
      </type>
       <desc>
        <p>Starts a server listening for SSH connections on the given port. If the <c>Port</c> is 0,
	a random free port is selected. See <seemfa marker="#daemon_info/1">daemon_info/1</seemfa>
	about how to find the selected port number.
	</p>
	<p>As an alternative, an already open TCP socket could be passed to the function in <c>TcpSocket</c>.
	The SSH initiation and negotiation will be initiated on that one when an SSH starts at the other end
	of the TCP socket.
	</p>
	<p>For a description of the options, see <seetype marker="#daemon_options">Daemon Options</seetype>.
	</p>
	<p>Please note that by historical reasons both the <c>HostAddress</c> argument and the
	<seetype marker="kernel:gen_tcp#connect_option">gen_tcp connect_option() <c>{ip,Address}</c></seetype>
	set the listening address. This is a source of possible inconsistent settings.
	</p>
	<p>The rules for handling the two address passing options are:</p>
	<list>
	  <item>if <c>HostAddress</c> is an IP-address, that IP-address is the listening address.
	  An 'ip'-option will be discarded if present.</item>

	  <item>if <c>HostAddress</c> is the atom <c>loopback</c>, the listening address
	  is <c>loopback</c> and an loopback address will be chosen by the underlying layers.
	  An 'ip'-option will be discarded if present.</item>

	  <item>if <c>HostAddress</c> is the atom <c>any</c> and no 'ip'-option is present, the listening address is
	  <c>any</c> and the socket will listen to all addresses</item>

	  <item>if <c>HostAddress</c> is <c>any</c> and an 'ip'-option is present, the listening address is
	  set to the value of the 'ip'-option</item>
	</list>
       </desc>
   </func>

<!-- DAEMON_REPLACE_OPTIONS/2 -->
   <func>
     <name name="daemon_replace_options" arity="2" since="OTP 25.1"/>
     <fsummary>Change options in a running daemon</fsummary>
     <desc>
       <p>
	 Replaces the options in a running daemon with the options in
	 <c>NewUserOptions</c>. Only connections established after this call
	 are affected, already established connections are not.
       </p>
       <note>
	 <p>In the final phase of this function, the listening process is restarted.
	 Therfore a connection attempt to the daemon in this final phase could fail.
	 </p>
       </note>
       <p>
	 The handling of Erlang configurations is described in the User's Guide;
	 see chapters
	 <seeguide marker="configurations">Configuration in SSH</seeguide>
	 and
	 <seeguide marker="configure_algos">Configuring algorithms in SSH</seeguide>.
       </p>
     </desc>
   </func>

<!-- DAEMON_INFO/1 -->
   <func>
     <name name="daemon_info" arity="1" since="OTP 19.0"/>
     <name name="daemon_info" arity="2" since="OTP 22.1"/>
     <fsummary>Get info about a daemon</fsummary>
     <desc>
       <p>Returns information about a daemon intended for e.g debugging or logging.
       </p>
       <p>When the <c>Key</c> is a single <c>Item</c>, the result is a single <c>InfoTuple</c>
       </p>
       <p>Note that <c>daemon_info/1</c> and <c>daemon_info/2</c> returns different types
       due to compatibility reasons.
       </p>
     </desc>
   </func>

<!-- DEFAULT_ALGORITHMS/0 -->
    <func>
      <name name="default_algorithms" arity="0" since="OTP 18.0"/>
      <fsummary>Get a list declaring the supported algorithms</fsummary>
      <desc>
	<p>Returns a key-value list, where the keys are the different types of algorithms and the values are the
	algorithms themselves.</p>
	<p>See the <seeguide marker="configure_algos#example_default_algorithms">User's Guide</seeguide> for
	an example.</p>
      </desc>
    </func>

<!-- SHELL/1,2,3 -->
    <func>
      <name since="">shell(Host | TcpSocket) -> Result </name>
      <name since="">shell(Host | TcpSocket, Options) -> Result </name>
      <name since="">shell(Host, Port, Options) -> Result </name>
      <fsummary>Starts an interactive shell on a remote SSH server.</fsummary>
      <type>
	<v>Host = <seetype marker="#host">host()</seetype></v>
	<v>TcpSocket = <seetype marker="#open_socket">open_socket()</seetype></v>
	<v>Port = <seetype marker="kernel:inet#port_number">inet:port_number()</seetype></v>
	<v>Options = <seetype marker="#client_options">client_options()</seetype></v>
	<v>Result = ok | {error, Reason::term()}</v>
      </type>
      <desc>
        <p>Connects to an SSH server at <c>Host</c> and <c>Port</c> (defaults to 22) and starts an
	interactive shell on that remote host.
	</p>
	<p>As an alternative, an already open TCP socket could be passed to the function in <c>TcpSocket</c>.
	The SSH initiation and negotiation will be initiated on that one and finally a shell will be started
	on the host at the other end of the TCP socket.
	</p>
	<p>For a description of the options, see <seetype marker="#client_options">Client Options</seetype>.</p>
	<p>The function waits for user input, and does not return until the remote shell is ended (that is,
	exit from the shell).
	</p>
      </desc>
    </func>

    <func>
      <name name="start" arity="0" since=""/>
      <name name="start" arity="1" since=""/>
      <fsummary>Starts the SSH application.</fsummary>
      <desc>
        <p>Utility function that starts the applications <c>crypto</c>, <c>public_key</c>,
	and <c>ssh</c>. Default type is <c>temporary</c>.
	For more information, see the <seeerl marker="kernel:application">application(3)</seeerl>
	manual page in Kernel.</p>
      </desc>
    </func>

    <func>
      <name name="stop" arity="0" since=""/>
      <fsummary>Stops the <c>ssh</c> application.</fsummary>
      <desc>
        <p>Stops the <c>ssh</c> application.
	For more information, see the <seeerl marker="kernel:application">application(3)</seeerl>
	manual page in Kernel.</p>
      </desc>
    </func>

    <func>
      <name name="stop_daemon" arity="1" since=""/>
      <name name="stop_daemon" arity="2" since=""/>
      <name name="stop_daemon" arity="3" since="OTP 21.0"/>
      <fsummary>Stops the listener and all connections started by the listener.</fsummary>
      <desc>
	<p>Stops the listener and all connections started by the listener.</p>
      </desc>
    </func>

    <func>
      <name name="stop_listener" arity="1" since=""/>
      <name name="stop_listener" arity="2" since=""/>
      <name name="stop_listener" arity="3" since="OTP 21.0"/>
      <fsummary>Stops the listener, but leaves existing connections started by the listener operational.</fsummary>
      <desc>
	<p>Stops the listener, but leaves existing connections started by the listener operational.</p>
      </desc>
    </func>

    <func>
      <name name="tcpip_tunnel_from_server" arity="5" since="OTP 23.0"/>
      <name name="tcpip_tunnel_from_server" arity="6" since="OTP 23.0"/>
      <fsummary>TCP/IP tunneling from a server to a client ("tcpip-forward")</fsummary>
      <desc>
	<p>Asks the remote server of <c>ConnectionRef</c> to listen to <c>ListenHost:ListenPort</c>.
	When someone connects that address, the connection is forwarded in an encrypted channel from
	the server to the client. The client (that is, at the node that calls this function) then
	connects to <c>ConnectToHost:ConnectToPort</c>.
	</p>
	<p>The returned <c>TrueListenPort</c> is the port that is listened to. It is the same as
	<c>ListenPort</c>, except when <c>ListenPort = 0</c>. In that case a free port is selected
	by the underlying OS.
	</p>
	<p>Note that in case of an Erlang/OTP SSH server (daemon) as peer, that server must have been
	started with the option
	<seetype marker="#tcpip_tunnel_out_daemon_option">tcpip_tunnel_out</seetype>
	to allow the connection.
	</p>
      </desc>
    </func>

    <func>
      <name name="tcpip_tunnel_to_server" arity="5" since="OTP 23.0"/>
      <name name="tcpip_tunnel_to_server" arity="6" since="OTP 23.0"/>
      <fsummary>TCP/IP tunneling from a client to a server ("direct-tcpip")</fsummary>
      <desc>
	<p>Tells the local client to listen to <c>ListenHost:ListenPort</c>.  When someone
	connects to that address, the connection is forwarded in an encrypted channel to the peer server
	of <c>ConnectionRef</c>. That server then connects to <c>ConnectToHost:ConnectToPort</c>.
	</p>
	<p>The returned <c>TrueListenPort</c> is the port that is listened to. It is the same as
	<c>ListenPort</c>, except when <c>ListenPort = 0</c>. In that case a free port is selected
	by the underlying OS.
	</p>
	<p>Note that in case of an Erlang/OTP SSH server (daemon) as peer, that server must have been
	started with the option
	<seetype marker="#tcpip_tunnel_in_daemon_option">tcpip_tunnel_in</seetype>
	to allow the connection.
	</p>
      </desc>
    </func>

    <func>
      <name since="OTP 24.0">hostkey_fingerprint(HostKey) -> string()</name>
      <name since="OTP 24.0">hostkey_fingerprint(DigestType, HostKey) -> string()</name>
      <name since="OTP 24.0">hostkey_fingerprint([DigestType], HostKey) -> [string()]</name>
      <fsummary>Calculates a ssh fingerprint for a hostkey.</fsummary>
      <type>
	<v>HostKey = <seetype marker="public_key:public_key#public_key">public_key:public_key()</seetype></v>
	<v>DigestType = <seetype marker="public_key:public_key#digest_type">public_key:digest_type()</seetype></v>
      </type>
      <desc>
	<p>Calculates a ssh fingerprint from a public host key as openssh does.</p>
	<p>The algorithm in <c>hostkey_fingerprint/1</c> is md5 to be compatible with older
	ssh-keygen commands. The string from the second variant is prepended by the algorithm name
	in uppercase as in newer ssh-keygen commands.</p>
	<p>Examples:</p>
      <code>
 2> ssh:hostkey_fingerprint(Key).
 "f5:64:a6:c1:5a:cb:9f:0a:10:46:a2:5c:3e:2f:57:84"

 3> ssh:hostkey_fingerprint(md5,Key).
 "MD5:f5:64:a6:c1:5a:cb:9f:0a:10:46:a2:5c:3e:2f:57:84"

 4> ssh:hostkey_fingerprint(sha,Key).
 "SHA1:bSLY/C4QXLDL/Iwmhyg0PGW9UbY"

 5> ssh:hostkey_fingerprint(sha256,Key).
 "SHA256:aZGXhabfbf4oxglxltItWeHU7ub3Dc31NcNw2cMJePQ"

 6> ssh:hostkey_fingerprint([sha,sha256],Key).
 ["SHA1:bSLY/C4QXLDL/Iwmhyg0PGW9UbY",
  "SHA256:aZGXhabfbf4oxglxltItWeHU7ub3Dc31NcNw2cMJePQ"]
    </code>
      </desc>
    </func>



  </funcs>

</erlref>