From 6213652225bca4199bae301041f2b56d21b4eed4 Mon Sep 17 00:00:00 2001 From: Hans Nilsson Date: Fri, 12 Oct 2018 12:39:07 +0200 Subject: ssh: Add reference manual page for the ssh_file module This callback module has the knowledge about the different files used by Erlang/OTP SSH. It was unfortunatly not documented previously. --- lib/ssh/doc/src/Makefile | 1 + lib/ssh/doc/src/ref_man.xml | 1 + lib/ssh/doc/src/specs.xml | 1 + lib/ssh/doc/src/ssh_file.xml | 214 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 217 insertions(+) create mode 100644 lib/ssh/doc/src/ssh_file.xml (limited to 'lib') diff --git a/lib/ssh/doc/src/Makefile b/lib/ssh/doc/src/Makefile index 07d4b24913..4e32dd9976 100644 --- a/lib/ssh/doc/src/Makefile +++ b/lib/ssh/doc/src/Makefile @@ -45,6 +45,7 @@ XML_REF3_FILES = \ ssh_connection.xml \ ssh_server_channel.xml \ ssh_server_key_api.xml \ + ssh_file.xml \ ssh_sftp.xml \ ssh_sftpd.xml \ diff --git a/lib/ssh/doc/src/ref_man.xml b/lib/ssh/doc/src/ref_man.xml index df37b0244f..60572b985b 100644 --- a/lib/ssh/doc/src/ref_man.xml +++ b/lib/ssh/doc/src/ref_man.xml @@ -40,6 +40,7 @@ + diff --git a/lib/ssh/doc/src/specs.xml b/lib/ssh/doc/src/specs.xml index acdbe2ddfd..a6517f3660 100644 --- a/lib/ssh/doc/src/specs.xml +++ b/lib/ssh/doc/src/specs.xml @@ -6,6 +6,7 @@ + diff --git a/lib/ssh/doc/src/ssh_file.xml b/lib/ssh/doc/src/ssh_file.xml new file mode 100644 index 0000000000..910c6698fc --- /dev/null +++ b/lib/ssh/doc/src/ssh_file.xml @@ -0,0 +1,214 @@ + + + + +
+ + 20182018 + Ericsson AB. All Rights Reserved. + + + 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. + + + + ssh_file + + + + +
+ ssh_file + Default callback module for the client's and server's database operations in the ssh application + +

This module is the default callback handler for the client's and the server's user and host "database" operations. +

+

+ The intention is to be compatible with the OpenSSH storage in files. Therefore it mimics directories and filenames + of OpenSSH. +

+ +

The functions are Callbacks for the SSH app. They are not intended to be called from the user's code! +

+
+
+
+ Making your own callback module +

Ssh_file implements the ssh_server_key_api and + ssh_client_key_api. + This enables the user to make an own interface using for example a database handler. +

+

Such another callback module could be used by setting the option + key_cb + when starting a client or a server (with for example + ssh:connect, + ssh:daemon of + ssh:shell + ). +

+
+ +
+ Files, directories and conventions + + + + LOCALUSER + The user name of the OS process running the Erlang virtual machine (emulator). +

+ + SYSDIR + SYSDIR is the directory holding the server's files: + + ssh_host_dsa_key - private dss host key (optional) + ssh_host_rsa_key - private rsa host key (optional) + ssh_host_ecdsa_key - private ecdsa host key (optional) + +

At least one host key must be defined. The default value of SYSDIR is /etc/ssh. +

+
+ + USERDIR + USERDIR is the directory holding the files: + + authorized_keys - list of keys allowed in public_key authorization (optional) + authorized_keys2 - list of keys allowed in public_key authorization (optional and unusual) + known_hosts - list of hosts visited (created by the client) + id_dsa - private dss user key (optional) + id_rsa - private rsa user key (optional) + id_ecdsa - private ecdsa user key (optional) + +

The default value of USERDIR is /home/LOCALUSER/.ssh. + See also the user_dir common option. +

+ +
+
+ + + + host_key(Algorithm, DaemonOptions) -> {ok, Key} | {error, Reason} + + +

Types and description

+

See the api description in + ssh_server_key_api, Module:host_key/2. +

+

Options

+ + {system_dir, SYSDIR} + + + + +

Files

+ + SYSDIR/ssh_host_rsa_key + SYSDIR/ssh_host_dsa_key + SYSDIR/ssh_host_ecdsa_key + +

 

+
+
+ + + is_auth_key(PublicUserKey, User, DaemonOptions) -> Result + + +

Types and description

+

See the api description in + ssh_server_key_api: Module:is_auth_key/3. +

+

Options

+ + {user_dir_fun, fun(RemoteUser) -> USERDIR end} + {user_dir, USERDIR} + +

Files

+ + USERDIR/authorized_keys + USERDIR/authorized_keys2 + +

 

+
+
+ + + add_host_key(HostNames, PublicHostKey, ConnectOptions) -> ok | {error, Reason} + + +

Types and description

+

See the api description in + ssh_client_key_api, Module:add_host_key/3. +

+

Option

+ + {user_dir, USERDIR} + +

File

+ + USERDIR/known_hosts + +

 

+
+
+ + + is_host_key(Key, Host, Algorithm, ConnectOptions) -> Result + + +

Types and description

+

See the api description in + ssh_client_key_api, Module:is_host_key/4. +

+

Option

+ + {user_dir, USERDIR} + +

File

+ + USERDIR/known_hosts + +

 

+
+
+ + + user_key(Algorithm, ConnectOptions) -> {ok, PrivateKey} | {error, Reason} + + +

Types and description

+

See the api description in + ssh_client_key_api, Module:user_key/2. +

+

Options

+ + {user_dir, USERDIR} + {dsa_pass_phrase, PWD} + {rsa_pass_phrase, PWD} + {ecdsa_pass_phrase, PWD} + +

Files

+ + USERDIR/id_dsa + USERDIR/id_rsa + USERDIR/id_ecdsa + +
+
+ +
+ +
-- cgit v1.2.3