File Transfer Protocol (FTP/SFTP)
Starting with Operator 5.0.7 and MinIO Server RELEASE.2023-04-20T17-56-55Z, you can use the SSH File Transfer Protocol (SFTP) to interact with the objects on a MinIO Operator Tenant deployment.
SFTP is defined by the Internet Engineering Task Force (IETF) as an extension of SSH 2.0. It allows file transfer over SSH for use with Transport Layer Security (TLS) and virtual private network (VPN) applications.
Enabling SFTP does not affect other MinIO features.
Starting with MinIO Server RELEASE.2023-04-20T17-56-55Z, you can use the File Transfer Protocol (FTP) to interact with the objects on a MinIO deployment.
You must specifically enable FTP or SFTP when starting the server. Enabling either server type does not affect other MinIO features.
This page uses the abbreviation FTP throughout, but you can use any of the supported FTP protocols described below.
Supported Protocols
Supported Commands
When enabled, MinIO supports the following SFTP operations:
get
put
ls
mkdir
rmdir
delete
MinIO does not support either append
or rename
operations.
Considerations
Versioning
SFTP clients can only operate on the latest version of an object. Specifically:
For read operations, MinIO only returns the latest version of the requested object(s) to the SFTP client.
For write operations, MinIO applies normal versioning behavior and creates a new object version at the specified namespace.
rm
andrmdir
operations createDeleteMarker
objects.
Authentication and Access
SFTP access requires the same authentication as any other S3 client. MinIO supports the following authentication providers:
MinIO IDP users and their service accounts
Active Directory/LDAP users and their service accounts
OpenID/OIDC service accounts
STS credentials cannot access buckets or objects over SFTP.
Authenticated users can access buckets and objects based on the policies assigned to the user or parent user account.
The SFTP protocol does not require any of the admin:*
permissions.
You may not perform other MinIO admin actions with SFTP.
Prerequisites
Procedure
Connect to MinIO Using SFTP with a Certificate Key File
New in version RELEASE.2024-05-07T06-41-25Z.
MinIO supports mutual TLS (mTLS) certificate-based authentication on SFTP, where both the server and the client verify the authenticity of each other.
This type of authentication requires the following:
Public key file for the trusted certificate authority
Public key file for the MinIO Server minted and signed by the trusted certificate authority
Public key file for the user minted and signed by the trusted certificate authority for the client connecting by SFTP and located in the user’s
.ssh
folder (or equivalent for the operating system)
The keys must include a principals list of the user(s) that can authenticate with the key:
ssh-keygen -s ~/.ssh/ca_user_key -I miniouser -n miniouser -V +1h -z 1 miniouser1.pub
-s
specifies the path to the certificate authority public key to use for generating this key. The specified public key must have aprincipals
list that includes this user.-I
specifies the key identity for the public key.-n
creates theuser principals
list for which this key is valid. You must include the user for which this key is valid, and the user must match the username in MinIO.-V
limits the duration for which the generated key is valid. In this example, the key is valid for one hour. Adjust the duration for your requirements.-z
adds a serial number to the key to distinguish this generated public key from other keys signed by the same certificate authority public key.
MinIO requires specifying the Certificate Authority used to sign the certificates for SFTP access.
Start or restart the MinIO Server and specify the path to the trusted certificate authority’s public key using an --sftp="trusted-user-ca-key=PATH"
flag:
minio server {path-to-server} --sftp="trusted-user-ca-key=/path/to/.ssh/ca_user_key.pub" {...other flags}
When connecting to the MinIO Server with SFTP, the client verifies the MinIO Server’s certificate. The client then passes its own certificate to the MinIO Server. The MinIO Server verifies the key created above by comparing its value to the the known public key from the certificate authority provided at server startup.
Once the MinIO Server verifies the client’s certificate, the user can connect to the MinIO server over SFTP:
sftp -P <SFTP port> <server IP>
Require service account or LDAP for authentication
To force authentication to SFTP using LDAP or service account credentials, append a suffix to the username.
Valid suffixes are either =ldap
or =svc
.
> sftp -P 8022 my-ldap-user=ldap@[minio@localhost]:/bucket
> sftp -P 8022 my-ldap-user=svc@[minio@localhost]:/bucket
Replace
my-ldap-user
with the username to use.Replace
[minio@localhost]
with the address of the MinIO server.