SFTP-SERVER(8)
โจ SFTP-SERVER(8) โจ
okay bestie, gather round, because today we're talking about sftp-server โ the OpenSSH SFTP server subsystem ๐
she's the whole entire server side of the SFTP protocol and she's serving, fr fr.
๐ NAME ๐
sftp-server โ OpenSSH SFTP server subsystem
๐ธ SYNOPSIS ๐ธ
sftp-server [-ehR] [-d start_directory] [-f log_facility] [-l log_level]
[-P denied_requests] [-p allowed_requests] [-u umask]
[-m force_file_perms]
sftp-server -Q protocol_feature
๐ DESCRIPTION ๐
so like. sftp-server is a program that speaks the server side of the SFTP protocol to stdout, and it's expecting client requests to come in from stdin. no cap. it is not meant to be called directly by you, bestie โ no ma'am โ it gets called from sshd(8) using the Subsystem option. iykyk.
any command-line flags you want to give sftp-server should be specified in the Subsystem declaration. go read sshd_config(5) for the deets. ๐
the valid options are... (drumroll please) ๐ฅ
๐ OPTIONS ๐
-d start_directoryโ sets an alternate starting directory for users. the pathname can contain these lil tokens that get expanded at runtime:%%becomes a literal%,%dbecomes the home directory of the user being authenticated, and%ubecomes the username of that user. default? just the user's home directory, obviously. this option is super useful when you're pairing it with theChrootDirectoryoption fromsshd_config(5). ๐-eโ makessftp-serverprint its logging info to stderr instead of syslog, for debugging. it's giving "i need to see everything right now" energy. ๐-f log_facilityโ picks the facility code used when logging messages fromsftp-server. the possible values are:DAEMON,USER,AUTH,LOCAL0,LOCAL1,LOCAL2,LOCAL3,LOCAL4,LOCAL5,LOCAL6,LOCAL7. the default isAUTH. periodt. โจ-hโ displayssftp-serverusage information. the classic "help me help you" flag ๐ซถ-l log_levelโ says which messagessftp-serverwill log. possible values are:QUIET,FATAL,ERROR,INFO,VERBOSE,DEBUG,DEBUG1,DEBUG2, andDEBUG3.INFOandVERBOSElog the transactions thatsftp-serverperforms on behalf of the client.DEBUGandDEBUG1are equivalent.DEBUG2andDEBUG3each specify higher levels of debugging output. default isERROR. ๐ฃ๏ธ-P denied_requestsโ a comma-separated list of SFTP protocol requests that are banned by the server.sftp-serverwill reply to any denied request with a failure. you can use the-Qflag to figure out the supported request types. and heads up: if you specify both a denied and an allowed list, the denied list gets applied before the allowed list. ๐ซ-p allowed_requestsโ a comma-separated list of SFTP protocol requests that are permitted by the server. every request type that's not on the allowed list will be logged and replied to with a failure message.
โ ๏ธ care must be taken when using this feature to ensure that requests made implicitly by SFTP clients are permitted. like, don't accidentally lock out the stuff your own client needs, bestie, that's a self-own ๐ญ
-Q protocol_featureโ queries the protocol features supported bysftp-server. at present the only feature that may be queried is โrequestsโ, which may be used to deny or allow specific requests (that's flags-Pand-prespectively). ๐-Rโ places this instance ofsftp-serverinto read-only mode. attempts to open files for writing, plus other operations that change the state of the filesystem, will be denied. no touchy. ๐ โ๏ธ-u umaskโ sets an explicitumask(2)to be applied to newly-created files and directories, instead of the user's default mask. ๐ฑ-m force_file_permsโ sets explicit file permissions applied to newly-created files, instead of the default or client-requested mode. numeric values include:777,755,750,666,644,640, etc. and listen โ using both-mand-uswitches makes the umask (-u) effective only for newly created directories, and the explicit mode (-m) for newly created files. slay, but keep that straight. ๐
on some systems, sftp-server must be able to access /dev/log for logging to work, and use of sftp-server in a chroot configuration therefore requires that syslogd(8) establish a logging socket inside the chroot directory. lowkey important, don't skip this one ๐ง
๐ SEE ALSO ๐
sftp(1)ssh(1)sshd_config(5)sshd(8)- T. Ylonen and S. Lehtinen, SSH File Transfer Protocol,
draft-ietf-secsh-filexfer-02.txt, October 2001, work in progress material. ๐
๐ฆ HISTORY ๐ฆ
sftp-server first appeared in OpenBSD 2.8. an icon, an OG, a legend. ๐
๐ AUTHORS ๐
Markus Friedl <markus@openbsd.org> โ thank you for your service, king ๐ซก
and that's the whole vibe check, bestie ๐ this page came from the Debian crew, dated July 27, 2021, and it lives in the SFTP-SERVER(8) section of the manual โ go forth and sftp responsibly, mwah ๐โจ๐ธ
๐ฆ where this page comes from
- centos-stream 10: openssh-server 9.9p1-34.el10 ยท BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- centos-stream 9: openssh-server 9.9p1-16.el9 ยท BSD
- fedora 43: openssh-server 10.0p1-12.fc43
- fedora 43: openssh-server 10.0p1-14.fc43 ยท BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 43: openssh-server 10.0p1-5.fc43 ยท BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND sprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 44: openssh-server 10.2p1-14.fc44
- fedora 44: openssh-server 10.2p1-16.fc44 ยท BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 44: openssh-server 10.2p1-7.fc44 ยท BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- Copyright (c) 2000 Markus Friedl. All rights reserved
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms