SecureBlackbox 2020 Python Edition

Questions / Feedback?

SFTPServer Class

Properties   Methods   Events   Configuration Settings   Errors  

The SFTPServer class provides server-side functionality for SFTP connections.

Syntax

class secureblackbox.SFTPServer

Remarks

TElSFTPServer is an implementation for SSH File Transfer Protocol server. It works over a secure SSH channel, and should not be confused with the FTP/FTPS protocol.

Property List


The following is the full list of the properties of the class with short descriptions. Click on the links for further details.

activeSpecifies whether the SFTP server has started and ready to accept connections.
auth_typesDefines allowed authentication types.
base_dirSpecifies the server's base (root) directory.
client_file_entry_a_timeContains the last access time for this file, in UTC.
client_file_entry_c_timeContains this file's creation time, in UTC.
client_file_entry_directorySpecifies whether this entry is a directory.
client_file_entry_file_typeSpecifies the type of this entry, one of the following: cftFile 0 cftDirectory 1 cftSymblink 2 cftSpecial 3 cftUnknown 4 cftSocket 5 cftCharDevice 6 cftBlockDevice 7 cftFIFO 8 .
client_file_entry_group_executeControls file execution permission for the group users.
client_file_entry_group_readControls file read permission for the group users.
client_file_entry_group_writeControls file write permission for the group users.
client_file_entry_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
client_file_entry_long_nameContains the long name of the file (human-readable, ftp-like).
client_file_entry_m_timeSpecifies the last modification time, in UTC.
client_file_entry_nameSpecifies the file name.
client_file_entry_other_executeControls file execution permission for other users (users that are neither owners, nor belong to the same group).
client_file_entry_other_readControls file read permission for other users (users that are neither owners, nor belong to the same group).
client_file_entry_other_writeControls file write permission for other users (users that are neither owners, nor belong to the same group).
client_file_entry_ownerSpecifies the owner of the file/directory.
client_file_entry_pathContains the full path to the file.
client_file_entry_sizeThe size of the file in bytes.
client_file_entry_user_executeControls file execution permission for the file owner.
client_file_entry_user_readControls file read permission for the file owner.
client_file_entry_user_writeControls file write permission for the file owner.
compression_levelSpecifies the preferable compression level.
external_crypto_custom_paramsCustom parameters to be passed to the signing service (uninterpreted).
external_crypto_dataAdditional data to be included in the async state and mirrored back by the requestor.
external_crypto_external_hash_calculationSpecifies whether the message hash is to be calculated at the external endpoint.
external_crypto_hash_algorithmSpecifies the request's signature hash algorithm.
external_crypto_key_idThe ID of the pre-shared key used for DC request authentication.
external_crypto_key_secretThe pre-shared key used for DC request authentication.
external_crypto_methodSpecifies the asynchronous signing method.
external_crypto_modeSpecifies the external cryptography mode.
external_crypto_public_key_algorithmProvide public key algorithm here if the certificate is not available on the pre-signing stage.
force_compressionThis property specifies whether server explicitly requires data compression.
hostSpecifies server's host name.
key_fingerprint_sha1Contains the SHA-1 fingerprint (hash) of the key.
key_fingerprint_sha256Contains the SHA-256 fingerprint (hash) of the key.
key_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
max_sftp_versionMaximum SFTP version supported.
min_sftp_versionMinimum SFTP version supported.
pinned_client_addressThe client's IP address.
pinned_client_client_key_algorithmSpecifies the client's key algorithm.
pinned_client_client_key_bitsSpecifies the length of the client's key.
pinned_client_client_key_fingerprintThe fingerprint (hash value) of the client's public key.
pinned_client_client_software_nameReturns the name of the SSH software running on the client side.
pinned_client_close_reasonContains the line sent by the client just before closing the connection.
pinned_client_compression_algorithm_inboundCompression algorithm for the incoming traffic.
pinned_client_compression_algorithm_outboundCompression algorithm for the outgoing traffic.
pinned_client_encryption_algorithm_inboundEncryption algorithm for the incoming traffic.
pinned_client_encryption_algorithm_outboundEncryption algorithm for the outgoing traffic.
pinned_client_idThe client connection's unique identifier.
pinned_client_inbound_encryption_key_bitsSpecifies the length of the key used to encrypt the incoming traffic.
pinned_client_kex_algorithmThe key exchange algorithm used during the SSH handshake.
pinned_client_kex_bitsThe number of bits used by the key exchange algorithm.
pinned_client_kex_linesThe contents of the received KexInit packet.
pinned_client_mac_algorithm_inboundMAC algorithm used for the incoming connection.
pinned_client_mac_algorithm_outboundMAC algorithm used for outbound connection.
pinned_client_outbound_encryption_key_bitsSpecifies the length of the key used to encrypt the outgoing traffic.
pinned_client_portThe remote port of the client connection.
pinned_client_public_key_algorithmSpecifies the public key algorithm which was used during the SSH handshake.
pinned_client_server_key_bitsSpecifies the number of bits in the server's key.
pinned_client_server_key_fingerprintThe fingerprint (hash value) of the server's public key.
pinned_client_total_bytes_receivedReturns the total number of bytes received over this connection.
pinned_client_total_bytes_sentReturns the total number of bytes sent over this connection.
pinned_client_versionSpecifies SSH protocol version.
portSpecifies the listening port number.
read_onlySpecifies whether files on the server are read-only.
server_key_countThe number of records in the ServerKey arrays.
server_key_algorithmSpecifies the key algorithm.
server_key_bitsThe number of bits in the key: the more the better, 2048 or 4096 are typical values.
server_key_fingerprint_md5Contains the MD5 fingerprint (hash) of the key.
server_key_fingerprint_sha1Contains the SHA-1 fingerprint (hash) of the key.
server_key_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
socket_incoming_speed_limitThe maximum number of bytes to read from the socket, per second.
socket_local_addressThe local network interface to bind the socket to.
socket_local_portThe local port number to bind the socket to.
socket_outgoing_speed_limitThe maximum number of bytes to write to the socket, per second.
socket_timeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
socket_use_i_pv6Enables or disables IP protocol version 6.
ssh_settings_auto_adjust_ciphersWhether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
ssh_settings_base_configurationAllows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
ssh_settings_compression_algorithmsA list of session compression algorithms separated with commas or semicolons.
ssh_settings_compression_levelPossible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
ssh_settings_default_window_sizeThe SSH window size specifies how many bytes the client can send to the server in the command channel without obtaining pre-authorization for the further send from the server.
ssh_settings_encryption_algorithmsA list of session encryption algorithms separated with commas or semicolons.
ssh_settings_force_compressionWhether the SSH client should explicitly request compression.
ssh_settings_gss_auth_typesA comma-separated list of authentication types.
ssh_settings_gss_delegate_credsSwitches credential delegation on or off.
ssh_settings_gss_hostnameThe GSS host name, in form of a FQDN (e.
ssh_settings_gss_libA path to the GSS-API library (DLL or SO).
ssh_settings_gss_mechanismsA comma-separated list of GSS mechanisms to use.
ssh_settings_gss_protocolsA comma-separated list of SSPI protocols.
ssh_settings_handshake_timeoutSpecifies the maximal time for the SSH handshake to proceed, in seconds.
ssh_settings_kex_algorithmsA list of key exchange algorithms separated with commas or semicolons.
ssh_settings_mac_algorithmsA list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
ssh_settings_max_ssh_packet_sizeSpecifies the maximum length of one SSH packet in bytes.
ssh_settings_min_window_sizeSpecifies the minimal internal window size.
ssh_settings_obfuscate_handshakeEnables or disables handshake obfuscation.
ssh_settings_obfuscation_passwordSpecifies the password used to encrypt the handshake when ObfuscateHandshake is set.
ssh_settings_public_key_algorithmsA list of public key algorithms separated with commas or semicolons.
ssh_settings_request_password_changeWhether to request a password change when connecting.
ssh_settings_software_nameThe name to be used by the class to identify itself.
ssh_settings_trust_all_keysEnables or disables explicit trust to all server keys.
ssh_settings_use_auth_agentEnables or disables the use of external key agent, such as Putty key agent.
ssh_settings_versionsSpecifies enabled SSH protocol versions (1 or 2).
user_countThe number of records in the User arrays.
user_associated_dataContains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
user_base_pathBase path for this user in the server's file system.
user_certContains the user's certificate.
user_dataContains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
user_handleAllows to get or set a 'handle', a unique identifier of the underlying property object.
user_hash_algorithmSpecifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.
user_incoming_speed_limitSpecifies the incoming speed limit for this user.
user_otp_algorithmThe algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).
user_otp_valueThe user's time interval (TOTP) or Counter (HOTP).
user_outgoing_speed_limitSpecifies the outgoing speed limit for this user.
user_passwordThe user's authentication password.
user_password_lenSpecifies the length of the user's OTP password.
user_shared_secretContains the user's secret key, which is essentially a shared secret between the client and server.
user_ssh_keyContains the user's SSH key.
user_usernameThe registered name (login) of the user.
use_utf8Specifies whether UTF8 conversion is to be used when parsing file names.

Method List


The following is the full list of the methods of the class with short descriptions. Click on the links for further details.

configSets or retrieves a configuration setting.
drop_clientTerminates a client connection.
get_client_bufferAcquires a piece of operation data.
get_client_file_entryAcquires file entry details from the class.
list_clientsEnumerates the connected clients.
pin_clientTakes a snapshot of the connection's properties.
set_client_bufferCommits a data buffer to the server class.
set_client_file_entryCommits the file entry details to the class.
startStarts SFTP server operation.
stopStops SFTP server.

Event List


The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.

on_acceptThis event is fired when new incoming connection is accepted.
on_after_create_directoryThis event indicates completion of directory creation request.
on_after_removeThis event indicates completion of file removal request.
on_after_rename_fileThis event indicates completion of a file rename operation.
on_after_request_attributesThis event indicates completion of file attributes request.
on_after_set_attributesThis event indicates completion of a set attributes request.
on_auth_attemptReports a user authentication attempt.
on_auth_failedReports user authentication failure.
on_auth_passwordThis event is fired on password authentication attempt from a client.
on_auth_public_keyThis event is fired on public key authentication attempt from a client.
on_auth_succeededReports a successful user authentication.
on_before_create_directoryThis event is fired when a client requests to create a directory.
on_before_download_fileThis event is fired when a download file request is received.
on_before_findThis event is fired when a client requests to find files and folders in Path.
on_before_removeThis event is fired when a client requests to delete a file or directory.
on_before_rename_fileThis event is fired when a client requests to rename a file.
on_before_request_attributesThis event is fired when a client requests to get file attributes.
on_before_set_attributesThis event is fired when a client requests to set file attributes.
on_before_upload_fileThis event is fired when an upload file request is received.
on_close_fileThis event instructs the application to close an opened file.
on_connectThis event is fired when a remote connection has been established.
on_create_directoryThis event instructs the application to create a directory.
on_disconnectThis event is fired when a client has disconnected.
on_errorInformation about errors during data delivery.
on_external_signHandles remote or external signing initiated by the server protocol.
on_find_closeThis event signifies the completion of a custom file listing operation.
on_find_firstThis event signifies the start of the custom file listing retrieval mechanism.
on_find_nextThis event retrieves the next entry of a custom file listing.
on_notificationThis event notifies the application about an underlying control flow event.
on_open_fileThis event instructs the application to handle the file open request.
on_read_fileThis event is fired when a file read request is received.
on_removeThis event is fired when a client requests to delete a file or directory.
on_rename_fileThis event is fired when a client requests to rename a file.
on_request_attributesThis event is fired when a get file attributes request is received.
on_session_closedReports session closure.
on_session_establishedThis event is fired when a new session is established.
on_set_attributesThis event is fired when an set file attributes request is received.
on_write_fileThis event is fired when a file write request is received.

Configuration Settings


The following is a list of configuration settings for the class with short descriptions. Click on the links for further details.

AuthModeControls dual/multi-type authentication mode.
CustomDHGroupIndexSets a specific Diffie-Hellman group index to enforce.
DualStackAllows the use of ip4 and ip6 simultaneously.
MaxDHGroupSizeSets the maximal Diffie-Hellman group size.
MinDHGroupSizeSets the minimal Diffie-Hellman group size.
NotifyOnFileOperationsEnables low-level file operation notifications.
CheckKeyIntegrityBeforeUseEnables or disable private key integrity check before use.
CookieCachingSpecifies whether a cookie cache should be used for HTTP(S) transports.
CookiesGets or sets local cookies for the class (supported for HTTPClient, RESTClient and SOAPClient only).
DefDeriveKeyIterationsSpecifies the default key derivation algorithm iteration count.
EnableClientSideSSLFFDHEEnables or disables finite field DHE key exchange support in TLS clients.
GlobalCookiesGets or sets global cookies for all the HTTP transports.
HttpUserAgentSpecifies the user agent name to be used by all HTTP clients.
LogDestinationSpecifies the debug log destination.
LogDetailsSpecifies the debug log details to dump.
LogFileSpecifies the debug log filename.
LogFiltersSpecifies the debug log filters.
LogFlushModeSpecifies the log flush mode.
LogLevelSpecifies the debug log level.
LogMaxEventCountSpecifies the maximum number of events to cache before further action is taken.
LogRotationModeSpecifies the log rotation mode.
MaxASN1BufferLengthSpecifies the maximal allowed length for ASN.1 primitive tag data.
MaxASN1TreeDepthSpecifies the maximal depth for processed ASN.1 trees.
OCSPHashAlgorithmSpecifies the hash algorithm to be used to identify certificates in OCSP requests.
UseOwnDNSResolverSpecifies whether the client classes should use own DNS resolver.
UseSharedSystemStoragesSpecifies whether the validation engine should use a global per-process copy of the system certificate stores.
UseSystemOAEPAndPSSEnforces or disables the use of system-driven RSA OAEP and PSS computations.
UseSystemRandomEnables or disables the use of the OS PRNG.

Copyright (c) 2022 /n software inc. - All rights reserved.
SecureBlackbox 2020 Python Edition - Version 20.0 [Build 8154]