Skip to content

P6Sftpd

Platform 6 SSH File Transfer Protocol Consumer is an sftp server that listens for and accepts SSH connections and provides a virtual file system for the collection and delivery of files.

URI Format

p6sftpd:///[?options]

You can append query options to the URI in the following format:

?options=value&option2=value&...

Query parameters

Name Description Default Type
port SSH listen port. 2222 Numeric
root Path to the root of the users virtual file systems file://${P6_DATA}/resources/sshd URI
auth Authentication mechanism. (FILE or P6AUTH) FILE String

Note

FILE authentication is provided for simple backward compatibility with b2box5

Authentication

FILE

The following folder structure must exist below the defined {root}

conf/users

Note

The component will auto create the folder structure if it does not exist.

The conf folder must contain the file: sftp.hostkey.ser which contains the ssh keypair of the host. If this file does not exist it will be generated during the SFTP adapter first run.

Warning

It is not possible at this time to use a preexisting key pair.

Password based

To authenticate using password, create a file in users that has the same name as the username and has the extension .pwd (e.g. {root}/conf/users/toto.pwd).

The password file should contain a single word consisting of the password.

Key based

It is also possible to authenticate using keys, which gives the opportunity to automate the connection.

The public key must be available in the users directory and must be called username.key ( e.g. {root}/conf/users/toto.key). The public key must in unencrypted PKCS8 format. To get it, the easiest is to recover the public key in SSH format generated by the customer/user (the id_rsa.pub file) which looks like

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0tD+…L091X/YAMofyv bgrieder@Mac-BG.local
and convert it to the appropriate format using the command line ssh-keygen utility

$ ssh-keygen -e -m PKCS8 -f id_rsa.pub
which will generate something that looks like that and which needs to go in the username.key file.

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtLQ/qNRPAS58LuE5++RG
…
Pdj5jJcdc69hw+npLO72bJ0KlltC2NFnnVleF0UoDFqT6cQG8Q95S9PdV/2ADKH8
rwIDAQAB
-----END PUBLIC KEY-----

P6AUTH

Not currently supported. (Will defer all authentication to p6auth)

Using FTP Consumer Events

See: See: Using FTP Consumer Events

Examples

    from('p6sftpd:///')
        .description('SFTP Listener')
        .to("log:p6.sftpd")
        .routeId('SFTP_Listener')