mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-11-23 22:04:50 +02:00
7.2 KiB
7.2 KiB
Account's configuration properties
For each account, the following properties can be configured:
usernamepasswordused for password authentication. For users created using SFTPGo REST API, if the password has no known hashing algo prefix, it will be stored using argon2id. SFTPGo supports checking passwords stored with bcrypt, pbkdf2, md5crypt and sha512crypt too. For pbkdf2 the supported format is$<algo>$<iterations>$<salt>$<hashed pwd base64 encoded>, where algo ispbkdf2-sha1orpbkdf2-sha256orpbkdf2-sha512. For example thepbkdf2-sha256of the wordpasswordusing 150000 iterations andE86a9YMX3zC7as salt must be stored as$pbkdf2-sha256$150000$E86a9YMX3zC7$R5J62hsSq+pYw00hLLPKBbcGXmq7fj5+/M0IFoYtZbo=. For bcrypt the format must be the one supported by golang's crypto/bcrypt package, for example the passwordsecretwith cost14must be stored as$2a$14$ajq8Q7fbtFRQvXpdCq7Jcuy.Rx1h/L4J60Otx.gyNLbAYctGMJ9tK. For md5crypt and sha512crypt we support the format used in/etc/shadowwith the$1$and$6$prefix, this is useful if you are migrating from Unix system user accounts. We support Apache md5crypt ($apr1$prefix) too. Using the REST API you can send a password hashed as bcrypt, pbkdf2, md5crypt or sha512crypt and it will be stored as is.public_keysarray of public keys. At least one public key or the password is mandatory.status1 means "active", 0 "inactive". An inactive account cannot login.expiration_dateexpiration date as unix timestamp in milliseconds. An expired account cannot login. 0 means no expiration.home_dirthe user cannot upload or download files outside this directory. Must be an absolute path.virtual_folderslist of mappings between virtual SFTP/SCP paths and local filesystem paths outside the user home directory. The specified paths must be absolute and the virtual path cannot be "/", it must be a sub directory. The parent directory for the specified virtual path must exist. SFTPGo will try to automatically create any missing parent directory for the configured virtual folders at user loginuid,gid. If SFTPGo runs as root system user then the created files and directories will be assigned to this system uid/gid. Ignored on windows or if SFTPGo runs as non root user: in this case files and directories for all SFTP users will be owned by the system user that runs SFTPGo.max_sessionsmaximum concurrent sessions. 0 means unlimited.quota_sizemaximum size allowed as bytes. 0 means unlimited.quota_filesmaximum number of files allowed. 0 means unlimited.permissionsthe following per directory permissions are supported:*all permissions are grantedlistlist items is alloweddownloaddownload files is alloweduploadupload files is allowedoverwriteoverwrite an existing file, while uploading, is allowed.uploadpermission is required to allow file overwritedeletedelete files or directories is allowedrenamerename files or directories is allowedcreate_dirscreate directories is allowedcreate_symlinkscreate symbolic links is allowedchmodchanging file or directory permissions is allowed. On Windows, only the 0200 bit (owner writable) of mode is used; it controls whether the file's read-only attribute is set or cleared. The other bits are currently unused. Use mode 0400 for a read-only file and 0600 for a readable+writable file.chownchanging file or directory owner and group is allowed. Changing owner and group is not supported on Windows.chtimeschanging file or directory access and modification time is allowed
upload_bandwidthmaximum upload bandwidth as KB/s, 0 means unlimited.download_bandwidthmaximum download bandwidth as KB/s, 0 means unlimited.allowed_ip, List of IP/Mask allowed to login. Any IP address not contained in this list cannot login. IP/Mask must be in CIDR notation as defined in RFC 4632 and RFC 4291, for example "192.0.2.0/24" or "2001:db8::/32"denied_ip, List of IP/Mask not allowed to login. If an IP address is both allowed and denied then login will be denieddenied_login_methods, List of login methods not allowed. The following login methods are supported:publickeypasswordkeyboard-interactive
file_extensions, list of struct. These restrictions do not apply to files listing for performance reasons, so a denied file cannot be downloaded/overwritten/renamed but it will still be listed in the list of files. Please note that these restrictions can be easily bypassed. Each struct contains the following fields:allowed_extensions, list of, case insensitive, allowed files extension. Shell like expansion is not supported so you have to specify.jpgand not*.jpg. Any file that does not end with this suffix will be denieddenied_extensions, list of, case insensitive, denied files extension. Denied file extensions are evaluated before the allowed onespath, SFTP/SCP path, if no other specific filter is defined, the filter apply for sub directories too. For example if filters are defined for the paths/and/subthen the filters for/are applied for any file outside the/subdirectory
fs_provider, filesystem to serve via SFTP. Local filesystem and S3 Compatible Object Storage are supporteds3_bucket, required for S3 filesystems3_region, required for S3 filesystem. Must match the region for your bucket. You can find here the list of available AWS regions. For example if your bucket is atFrankfurtyou have to set the region toeu-central-1s3_access_keys3_access_secret, if provided it is stored encrypted (AES-256-GCM)s3_endpoint, specifies a S3 endpoint (server) different from AWS. It is not required if you are connecting to AWSs3_storage_class, leave blank to use the default or specify a valid AWS storage classs3_key_prefix, allows to restrict access to the virtual folder identified by this prefix and its contentsgcs_bucket, required for GCS filesystemgcs_credentials, Google Cloud Storage JSON credentials base64 encodedgcs_automatic_credentials, integer. Set to 1 to use Application Default Credentials strategy or set to 0 to use explicit credentials viagcs_credentialsgcs_storage_classgcs_key_prefix, allows to restrict access to the virtual folder identified by this prefix and its contents
These properties are stored inside the data provider.
If you want to use your existing accounts, you have these options:
- If your accounts are aleady stored inside a supported database, you can create a database view. Since a view is read only, you have to disable user management and quota tracking so SFTPGo will never try to write to the view
- you can import your users inside SFTPGo. Take a look at sftpgo_api_cli.py, it can convert and import users from Linux system users and Pure-FTPd/ProFTPD virtual users
- you can use an external authentication program