1*b592f463Schristos.\" $NetBSD: sftp-server.8,v 1.14 2021/09/02 11:26:18 christos Exp $ 2*b592f463Schristos.\" $OpenBSD: sftp-server.8,v 1.31 2021/07/27 14:14:25 jmc Exp $ 3ca32bd8dSchristos.\" 4ca32bd8dSchristos.\" Copyright (c) 2000 Markus Friedl. All rights reserved. 5ca32bd8dSchristos.\" 6ca32bd8dSchristos.\" Redistribution and use in source and binary forms, with or without 7ca32bd8dSchristos.\" modification, are permitted provided that the following conditions 8ca32bd8dSchristos.\" are met: 9ca32bd8dSchristos.\" 1. Redistributions of source code must retain the above copyright 10ca32bd8dSchristos.\" notice, this list of conditions and the following disclaimer. 11ca32bd8dSchristos.\" 2. Redistributions in binary form must reproduce the above copyright 12ca32bd8dSchristos.\" notice, this list of conditions and the following disclaimer in the 13ca32bd8dSchristos.\" documentation and/or other materials provided with the distribution. 14ca32bd8dSchristos.\" 15ca32bd8dSchristos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16ca32bd8dSchristos.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17ca32bd8dSchristos.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18ca32bd8dSchristos.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 19ca32bd8dSchristos.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20ca32bd8dSchristos.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21ca32bd8dSchristos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22ca32bd8dSchristos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23ca32bd8dSchristos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24ca32bd8dSchristos.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25ca32bd8dSchristos.\" 26*b592f463Schristos.Dd July 27 2021 27ca32bd8dSchristos.Dt SFTP-SERVER 8 28ca32bd8dSchristos.Os 29ca32bd8dSchristos.Sh NAME 30ca32bd8dSchristos.Nm sftp-server 31ed75d7a8Schristos.Nd OpenSSH SFTP server subsystem 32ca32bd8dSchristos.Sh SYNOPSIS 33ca32bd8dSchristos.Nm sftp-server 348a4530f9Schristos.Bk -words 3534b27b53Sadam.Op Fl ehR 36ce11a51fSchristos.Op Fl d Ar start_directory 37ca32bd8dSchristos.Op Fl f Ar log_facility 38ca32bd8dSchristos.Op Fl l Ar log_level 392d3b0f52Schristos.Op Fl P Ar denied_requests 402d3b0f52Schristos.Op Fl p Ar allowed_requests 4134b27b53Sadam.Op Fl u Ar umask 428a4530f9Schristos.Ek 438a4530f9Schristos.Nm 448a4530f9Schristos.Fl Q Ar protocol_feature 45ca32bd8dSchristos.Sh DESCRIPTION 46ca32bd8dSchristos.Nm 47ca32bd8dSchristosis a program that speaks the server side of SFTP protocol 48ca32bd8dSchristosto stdout and expects client requests from stdin. 49ca32bd8dSchristos.Nm 50ca32bd8dSchristosis not intended to be called directly, but from 51ca32bd8dSchristos.Xr sshd 8 52ca32bd8dSchristosusing the 53ca32bd8dSchristos.Cm Subsystem 54ca32bd8dSchristosoption. 55ca32bd8dSchristos.Pp 56ca32bd8dSchristosCommand-line flags to 57ca32bd8dSchristos.Nm 58ca32bd8dSchristosshould be specified in the 59ca32bd8dSchristos.Cm Subsystem 60ca32bd8dSchristosdeclaration. 61ca32bd8dSchristosSee 62ca32bd8dSchristos.Xr sshd_config 5 63ca32bd8dSchristosfor more information. 64ca32bd8dSchristos.Pp 65ca32bd8dSchristosValid options are: 66ca32bd8dSchristos.Bl -tag -width Ds 67ce11a51fSchristos.It Fl d Ar start_directory 68*b592f463SchristosSpecifies an alternate starting directory for users. 69ce11a51fSchristosThe pathname may contain the following tokens that are expanded at runtime: 70ce11a51fSchristos%% is replaced by a literal '%', 71e4d43b82Schristos%d is replaced by the home directory of the user being authenticated, 72ce11a51fSchristosand %u is replaced by the username of that user. 73ce11a51fSchristosThe default is to use the user's home directory. 74ce11a51fSchristosThis option is useful in conjunction with the 75ce11a51fSchristos.Xr sshd_config 5 76ce11a51fSchristos.Cm ChrootDirectory 77ce11a51fSchristosoption. 7834b27b53Sadam.It Fl e 7934b27b53SadamCauses 8034b27b53Sadam.Nm 8134b27b53Sadamto print logging information to stderr instead of syslog for debugging. 82ca32bd8dSchristos.It Fl f Ar log_facility 83ca32bd8dSchristosSpecifies the facility code that is used when logging messages from 84ca32bd8dSchristos.Nm . 85ca32bd8dSchristosThe possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 86ca32bd8dSchristosLOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 87ca32bd8dSchristosThe default is AUTH. 8834b27b53Sadam.It Fl h 8934b27b53SadamDisplays 9034b27b53Sadam.Nm 9134b27b53Sadamusage information. 92ca32bd8dSchristos.It Fl l Ar log_level 93ca32bd8dSchristosSpecifies which messages will be logged by 94ca32bd8dSchristos.Nm . 95ca32bd8dSchristosThe possible values are: 96ca32bd8dSchristosQUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 97ca32bd8dSchristosINFO and VERBOSE log transactions that 98ca32bd8dSchristos.Nm 99ca32bd8dSchristosperforms on behalf of the client. 100ca32bd8dSchristosDEBUG and DEBUG1 are equivalent. 101ca32bd8dSchristosDEBUG2 and DEBUG3 each specify higher levels of debugging output. 102ca32bd8dSchristosThe default is ERROR. 1032d3b0f52Schristos.It Fl P Ar denied_requests 104*b592f463SchristosSpecifies a comma-separated list of SFTP protocol requests that are banned by 1058a4530f9Schristosthe server. 1068a4530f9Schristos.Nm 1072d3b0f52Schristoswill reply to any denied request with a failure. 1088a4530f9SchristosThe 1098a4530f9Schristos.Fl Q 1108a4530f9Schristosflag can be used to determine the supported request types. 1112d3b0f52SchristosIf both denied and allowed lists are specified, then the denied list is 1122d3b0f52Schristosapplied before the allowed list. 1132d3b0f52Schristos.It Fl p Ar allowed_requests 114*b592f463SchristosSpecifies a comma-separated list of SFTP protocol requests that are permitted 1158a4530f9Schristosby the server. 1162d3b0f52SchristosAll request types that are not on the allowed list will be logged and replied 1178a4530f9Schristosto with a failure message. 1188a4530f9Schristos.Pp 1198a4530f9SchristosCare must be taken when using this feature to ensure that requests made 1208a4530f9Schristosimplicitly by SFTP clients are permitted. 1218a4530f9Schristos.It Fl Q Ar protocol_feature 122*b592f463SchristosQueries protocol features supported by 1238a4530f9Schristos.Nm . 1248a4530f9SchristosAt present the only feature that may be queried is 1258a4530f9Schristos.Dq requests , 1262d3b0f52Schristoswhich may be used to deny or allow specific requests (flags 1278a4530f9Schristos.Fl P 1288a4530f9Schristosand 1298a4530f9Schristos.Fl p 1308a4530f9Schristosrespectively). 13134b27b53Sadam.It Fl R 13234b27b53SadamPlaces this instance of 13334b27b53Sadam.Nm 13434b27b53Sadaminto a read-only mode. 13534b27b53SadamAttempts to open files for writing, as well as other operations that change 13634b27b53Sadamthe state of the filesystem, will be denied. 13734b27b53Sadam.It Fl u Ar umask 13834b27b53SadamSets an explicit 13934b27b53Sadam.Xr umask 2 14034b27b53Sadamto be applied to newly-created files and directories, instead of the 14134b27b53Sadamuser's default mask. 142ca32bd8dSchristos.El 143ca32bd8dSchristos.Pp 1448a4530f9SchristosOn some systems, 145ca32bd8dSchristos.Nm 146ca32bd8dSchristosmust be able to access 1478a4530f9Schristos.Pa /dev/log 1488a4530f9Schristosfor logging to work, and use of 149ca32bd8dSchristos.Nm 15047dc7704Schristosin a chroot configuration therefore requires that 151ca32bd8dSchristos.Xr syslogd 8 152ca32bd8dSchristosestablish a logging socket inside the chroot directory. 153ca32bd8dSchristos.Sh SEE ALSO 154ca32bd8dSchristos.Xr sftp 1 , 155ca32bd8dSchristos.Xr ssh 1 , 156ca32bd8dSchristos.Xr sshd_config 5 , 157ca32bd8dSchristos.Xr sshd 8 158ca32bd8dSchristos.Rs 159ca32bd8dSchristos.%A T. Ylonen 160ca32bd8dSchristos.%A S. Lehtinen 161ca32bd8dSchristos.%T "SSH File Transfer Protocol" 16200a838c4Schristos.%N draft-ietf-secsh-filexfer-02.txt 16300a838c4Schristos.%D October 2001 164ca32bd8dSchristos.%O work in progress material 165ca32bd8dSchristos.Re 166ca32bd8dSchristos.Sh HISTORY 167ca32bd8dSchristos.Nm 168ca32bd8dSchristosfirst appeared in 169ca32bd8dSchristos.Ox 2.8 . 170ca32bd8dSchristos.Sh AUTHORS 171a5684d07Swiz.An Markus Friedl Aq Mt markus@openbsd.org 172