SecureBlackbox 2020 Node.js Edition

Questions / Feedback?

SFTPServer Class

Properties   Methods   Events   Configuration Settings   Errors  

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

Syntax

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.
AuthTypesDefines allowed authentication types.
BaseDirSpecifies the server's base (root) directory.
ClientFileEntryATimeContains the last access time for this file, in UTC.
ClientFileEntryCTimeContains this file's creation time, in UTC.
ClientFileEntryDirectorySpecifies whether this entry is a directory.
ClientFileEntryFileTypeSpecifies 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 .
ClientFileEntryGroupExecuteControls file execution permission for the group users.
ClientFileEntryGroupReadControls file read permission for the group users.
ClientFileEntryGroupWriteControls file write permission for the group users.
ClientFileEntryHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
ClientFileEntryLongNameContains the long name of the file (human-readable, ftp-like).
ClientFileEntryMTimeSpecifies the last modification time, in UTC.
ClientFileEntryNameSpecifies the file name.
ClientFileEntryOtherExecuteControls file execution permission for other users (users that are neither owners, nor belong to the same group).
ClientFileEntryOtherReadControls file read permission for other users (users that are neither owners, nor belong to the same group).
ClientFileEntryOtherWriteControls file write permission for other users (users that are neither owners, nor belong to the same group).
ClientFileEntryOwnerSpecifies the owner of the file/directory.
ClientFileEntryPathContains the full path to the file.
ClientFileEntrySizeThe size of the file in bytes.
ClientFileEntryUserExecuteControls file execution permission for the file owner.
ClientFileEntryUserReadControls file read permission for the file owner.
ClientFileEntryUserWriteControls file write permission for the file owner.
CompressionLevelSpecifies the preferable compression level.
ExternalCryptoCustomParamsCustom parameters to be passed to the signing service (uninterpreted).
ExternalCryptoDataAdditional data to be included in the async state and mirrored back by the requestor.
ExternalCryptoExternalHashCalculationSpecifies whether the message hash is to be calculated at the external endpoint.
ExternalCryptoHashAlgorithmSpecifies the request's signature hash algorithm.
ExternalCryptoKeyIDThe ID of the pre-shared key used for DC request authentication.
ExternalCryptoKeySecretThe pre-shared key used for DC request authentication.
ExternalCryptoMethodSpecifies the asynchronous signing method.
ExternalCryptoModeSpecifies the external cryptography mode.
ExternalCryptoPublicKeyAlgorithmProvide public key algorithm here if the certificate is not available on the pre-signing stage.
ForceCompressionThis property specifies whether server explicitly requires data compression.
HostSpecifies server's host name.
KeyFingerprintSHA1Contains the SHA-1 fingerprint (hash) of the key.
KeyFingerprintSHA256Contains the SHA-256 fingerprint (hash) of the key.
KeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
MaxSFTPVersionMaximum SFTP version supported.
MinSFTPVersionMinimum SFTP version supported.
PinnedClientAddressThe client's IP address.
PinnedClientClientKeyAlgorithmSpecifies the client's key algorithm.
PinnedClientClientKeyBitsSpecifies the length of the client's key.
PinnedClientClientKeyFingerprintThe fingerprint (hash value) of the client's public key.
PinnedClientClientSoftwareNameReturns the name of the SSH software running on the client side.
PinnedClientCloseReasonContains the line sent by the client just before closing the connection.
PinnedClientCompressionAlgorithmInboundCompression algorithm for the incoming traffic.
PinnedClientCompressionAlgorithmOutboundCompression algorithm for the outgoing traffic.
PinnedClientEncryptionAlgorithmInboundEncryption algorithm for the incoming traffic.
PinnedClientEncryptionAlgorithmOutboundEncryption algorithm for the outgoing traffic.
PinnedClientIDThe client connection's unique identifier.
PinnedClientInboundEncryptionKeyBitsSpecifies the length of the key used to encrypt the incoming traffic.
PinnedClientKexAlgorithmThe key exchange algorithm used during the SSH handshake.
PinnedClientKexBitsThe number of bits used by the key exchange algorithm.
PinnedClientKexLinesThe contents of the received KexInit packet.
PinnedClientMacAlgorithmInboundMAC algorithm used for the incoming connection.
PinnedClientMacAlgorithmOutboundMAC algorithm used for outbound connection.
PinnedClientOutboundEncryptionKeyBitsSpecifies the length of the key used to encrypt the outgoing traffic.
PinnedClientPortThe remote port of the client connection.
PinnedClientPublicKeyAlgorithmSpecifies the public key algorithm which was used during the SSH handshake.
PinnedClientServerKeyBitsSpecifies the number of bits in the server's key.
PinnedClientServerKeyFingerprintThe fingerprint (hash value) of the server's public key.
PinnedClientTotalBytesReceivedReturns the total number of bytes received over this connection.
PinnedClientTotalBytesSentReturns the total number of bytes sent over this connection.
PinnedClientVersionSpecifies SSH protocol version.
PortSpecifies the listening port number.
ReadOnlySpecifies whether files on the server are read-only.
ServerKeyCountThe number of records in the ServerKey arrays.
ServerKeyAlgorithmSpecifies the key algorithm.
ServerKeyBitsThe number of bits in the key: the more the better, 2048 or 4096 are typical values.
ServerKeyFingerprintMD5Contains the MD5 fingerprint (hash) of the key.
ServerKeyFingerprintSHA1Contains the SHA-1 fingerprint (hash) of the key.
ServerKeyHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
SocketIncomingSpeedLimitThe maximum number of bytes to read from the socket, per second.
SocketLocalAddressThe local network interface to bind the socket to.
SocketLocalPortThe local port number to bind the socket to.
SocketOutgoingSpeedLimitThe maximum number of bytes to write to the socket, per second.
SocketTimeoutThe maximum period of waiting, in milliseconds, after which the socket operation is considered unsuccessful.
SocketUseIPv6Enables or disables IP protocol version 6.
SSHSettingsAutoAdjustCiphersWhether the SSH client should adjust its list of supported ciphers 'on-the-fly' for greater compatibility with the server it is connecting to.
SSHSettingsBaseConfigurationAllows to choose base configuration of SSH settings, tuned up for different purposes such as high security or higher compatibility.
SSHSettingsCompressionAlgorithmsA list of session compression algorithms separated with commas or semicolons.
SSHSettingsCompressionLevelPossible values for the Compression Level range from 0 (minimum compression) to 9 (maximum compression).
SSHSettingsDefaultWindowSizeThe 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.
SSHSettingsEncryptionAlgorithmsA list of session encryption algorithms separated with commas or semicolons.
SSHSettingsForceCompressionWhether the SSH client should explicitly request compression.
SSHSettingsGSSAuthTypesA comma-separated list of authentication types.
SSHSettingsGSSDelegateCredsSwitches credential delegation on or off.
SSHSettingsGSSHostnameThe GSS host name, in form of a FQDN (e.
SSHSettingsGSSLibA path to the GSS-API library (DLL or SO).
SSHSettingsGSSMechanismsA comma-separated list of GSS mechanisms to use.
SSHSettingsGSSProtocolsA comma-separated list of SSPI protocols.
SSHSettingsHandshakeTimeoutSpecifies the maximal time for the SSH handshake to proceed, in seconds.
SSHSettingsKexAlgorithmsA list of key exchange algorithms separated with commas or semicolons.
SSHSettingsMacAlgorithmsA list of MAC (for message authentication code ) algorithms separated with commas or semicolons.
SSHSettingsMaxSSHPacketSizeSpecifies the maximum length of one SSH packet in bytes.
SSHSettingsMinWindowSizeSpecifies the minimal internal window size.
SSHSettingsObfuscateHandshakeEnables or disables handshake obfuscation.
SSHSettingsObfuscationPasswordSpecifies the password used to encrypt the handshake when ObfuscateHandshake is set.
SSHSettingsPublicKeyAlgorithmsA list of public key algorithms separated with commas or semicolons.
SSHSettingsRequestPasswordChangeWhether to request a password change when connecting.
SSHSettingsSoftwareNameThe name to be used by the class to identify itself.
SSHSettingsTrustAllKeysEnables or disables explicit trust to all server keys.
SSHSettingsUseAuthAgentEnables or disables the use of external key agent, such as Putty key agent.
SSHSettingsVersionsSpecifies enabled SSH protocol versions (1 or 2).
UserCountThe number of records in the User arrays.
UserAssociatedDataContains the user's Associated Data when SSH AEAD (Authenticated Encryption with Associated Data) algorithm is used.
UserBasePathBase path for this user in the server's file system.
UserCertContains the user's certificate.
UserDataContains uninterpreted user-defined data that should be associated with the user account, such as comments or custom settings.
UserHandleAllows to get or set a 'handle', a unique identifier of the underlying property object.
UserHashAlgorithmSpecifies the hash algorithm used to generate TOTP (Time-based One-Time Passwords) passwords for this user.
UserIncomingSpeedLimitSpecifies the incoming speed limit for this user.
UserOtpAlgorithmThe algorithm used to generate one-time passwords (OTP) for this user, either HOTP (Hash-based OTP) or TOTP (Time-based OTP).
UserOtpValueThe user's time interval (TOTP) or Counter (HOTP).
UserOutgoingSpeedLimitSpecifies the outgoing speed limit for this user.
UserPasswordThe user's authentication password.
UserPasswordLenSpecifies the length of the user's OTP password.
UserSharedSecretContains the user's secret key, which is essentially a shared secret between the client and server.
UserSSHKeyContains the user's SSH key.
UserUsernameThe registered name (login) of the user.
UseUTF8Specifies 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.
DropClientTerminates a client connection.
GetClientBufferAcquires a piece of operation data.
GetClientFileEntryAcquires file entry details from the class.
ListClientsEnumerates the connected clients.
PinClientTakes a snapshot of the connection's properties.
SetClientBufferCommits a data buffer to the server class.
SetClientFileEntryCommits 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.

AcceptThis event is fired when new incoming connection is accepted.
AfterCreateDirectoryThis event indicates completion of directory creation request.
AfterRemoveThis event indicates completion of file removal request.
AfterRenameFileThis event indicates completion of a file rename operation.
AfterRequestAttributesThis event indicates completion of file attributes request.
AfterSetAttributesThis event indicates completion of a set attributes request.
AuthAttemptReports a user authentication attempt.
AuthFailedReports user authentication failure.
AuthPasswordThis event is fired on password authentication attempt from a client.
AuthPublicKeyThis event is fired on public key authentication attempt from a client.
AuthSucceededReports a successful user authentication.
BeforeCreateDirectoryThis event is fired when a client requests to create a directory.
BeforeDownloadFileThis event is fired when a download file request is received.
BeforeFindThis event is fired when a client requests to find files and folders in Path.
BeforeRemoveThis event is fired when a client requests to delete a file or directory.
BeforeRenameFileThis event is fired when a client requests to rename a file.
BeforeRequestAttributesThis event is fired when a client requests to get file attributes.
BeforeSetAttributesThis event is fired when a client requests to set file attributes.
BeforeUploadFileThis event is fired when an upload file request is received.
CloseFileThis event instructs the application to close an opened file.
ConnectThis event is fired when a remote connection has been established.
CreateDirectoryThis event instructs the application to create a directory.
DisconnectThis event is fired when a client has disconnected.
ErrorInformation about errors during data delivery.
ExternalSignHandles remote or external signing initiated by the server protocol.
FindCloseThis event signifies the completion of a custom file listing operation.
FindFirstThis event signifies the start of the custom file listing retrieval mechanism.
FindNextThis event retrieves the next entry of a custom file listing.
NotificationThis event notifies the application about an underlying control flow event.
OpenFileThis event instructs the application to handle the file open request.
ReadFileThis event is fired when a file read request is received.
RemoveThis event is fired when a client requests to delete a file or directory.
RenameFileThis event is fired when a client requests to rename a file.
RequestAttributesThis event is fired when a get file attributes request is received.
SessionClosedReports session closure.
SessionEstablishedThis event is fired when a new session is established.
SetAttributesThis event is fired when an set file attributes request is received.
WriteFileThis 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 Node.js Edition - Version 20.0 [Build 8165]