xref: /dflybsd-src/crypto/openssh/sftp-server.8 (revision 50a69bb51183a7916e776f2c9f5fa64c999f1a2f)
1*50a69bb5SSascha Wildner.\" $OpenBSD: sftp-server.8,v 1.31 2021/07/27 14:14:25 jmc Exp $
218de8d7fSPeter Avalos.\"
318de8d7fSPeter Avalos.\" Copyright (c) 2000 Markus Friedl.  All rights reserved.
418de8d7fSPeter Avalos.\"
518de8d7fSPeter Avalos.\" Redistribution and use in source and binary forms, with or without
618de8d7fSPeter Avalos.\" modification, are permitted provided that the following conditions
718de8d7fSPeter Avalos.\" are met:
818de8d7fSPeter Avalos.\" 1. Redistributions of source code must retain the above copyright
918de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer.
1018de8d7fSPeter Avalos.\" 2. Redistributions in binary form must reproduce the above copyright
1118de8d7fSPeter Avalos.\"    notice, this list of conditions and the following disclaimer in the
1218de8d7fSPeter Avalos.\"    documentation and/or other materials provided with the distribution.
1318de8d7fSPeter Avalos.\"
1418de8d7fSPeter Avalos.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
1518de8d7fSPeter Avalos.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
1618de8d7fSPeter Avalos.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
1718de8d7fSPeter Avalos.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
1818de8d7fSPeter Avalos.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1918de8d7fSPeter Avalos.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2018de8d7fSPeter Avalos.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2118de8d7fSPeter Avalos.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2218de8d7fSPeter Avalos.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2318de8d7fSPeter Avalos.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2418de8d7fSPeter Avalos.\"
25*50a69bb5SSascha Wildner.Dd $Mdocdate: July 27 2021 $
2618de8d7fSPeter Avalos.Dt SFTP-SERVER 8
2718de8d7fSPeter Avalos.Os
2818de8d7fSPeter Avalos.Sh NAME
2918de8d7fSPeter Avalos.Nm sftp-server
300cbfa66cSDaniel Fojt.Nd OpenSSH SFTP server subsystem
3118de8d7fSPeter Avalos.Sh SYNOPSIS
3218de8d7fSPeter Avalos.Nm sftp-server
3336e94dc5SPeter Avalos.Bk -words
34856ea928SPeter Avalos.Op Fl ehR
3536e94dc5SPeter Avalos.Op Fl d Ar start_directory
3618de8d7fSPeter Avalos.Op Fl f Ar log_facility
3718de8d7fSPeter Avalos.Op Fl l Ar log_level
38*50a69bb5SSascha Wildner.Op Fl P Ar denied_requests
39*50a69bb5SSascha Wildner.Op Fl p Ar allowed_requests
40856ea928SPeter Avalos.Op Fl u Ar umask
4136e94dc5SPeter Avalos.Ek
4236e94dc5SPeter Avalos.Nm
4336e94dc5SPeter Avalos.Fl Q Ar protocol_feature
4418de8d7fSPeter Avalos.Sh DESCRIPTION
4518de8d7fSPeter Avalos.Nm
4618de8d7fSPeter Avalosis a program that speaks the server side of SFTP protocol
4718de8d7fSPeter Avalosto stdout and expects client requests from stdin.
4818de8d7fSPeter Avalos.Nm
4918de8d7fSPeter Avalosis not intended to be called directly, but from
5018de8d7fSPeter Avalos.Xr sshd 8
5118de8d7fSPeter Avalosusing the
5218de8d7fSPeter Avalos.Cm Subsystem
5318de8d7fSPeter Avalosoption.
5418de8d7fSPeter Avalos.Pp
5518de8d7fSPeter AvalosCommand-line flags to
5618de8d7fSPeter Avalos.Nm
5718de8d7fSPeter Avalosshould be specified in the
5818de8d7fSPeter Avalos.Cm Subsystem
5918de8d7fSPeter Avalosdeclaration.
6018de8d7fSPeter AvalosSee
6118de8d7fSPeter Avalos.Xr sshd_config 5
6218de8d7fSPeter Avalosfor more information.
6318de8d7fSPeter Avalos.Pp
6418de8d7fSPeter AvalosValid options are:
6518de8d7fSPeter Avalos.Bl -tag -width Ds
6636e94dc5SPeter Avalos.It Fl d Ar start_directory
67*50a69bb5SSascha WildnerSpecifies an alternate starting directory for users.
6836e94dc5SPeter AvalosThe pathname may contain the following tokens that are expanded at runtime:
6936e94dc5SPeter Avalos%% is replaced by a literal '%',
70e9778795SPeter Avalos%d is replaced by the home directory of the user being authenticated,
7136e94dc5SPeter Avalosand %u is replaced by the username of that user.
7236e94dc5SPeter AvalosThe default is to use the user's home directory.
7336e94dc5SPeter AvalosThis option is useful in conjunction with the
7436e94dc5SPeter Avalos.Xr sshd_config 5
7536e94dc5SPeter Avalos.Cm ChrootDirectory
7636e94dc5SPeter Avalosoption.
77856ea928SPeter Avalos.It Fl e
78856ea928SPeter AvalosCauses
79856ea928SPeter Avalos.Nm
80856ea928SPeter Avalosto print logging information to stderr instead of syslog for debugging.
8118de8d7fSPeter Avalos.It Fl f Ar log_facility
8218de8d7fSPeter AvalosSpecifies the facility code that is used when logging messages from
8318de8d7fSPeter Avalos.Nm .
8418de8d7fSPeter AvalosThe possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
8518de8d7fSPeter AvalosLOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
8618de8d7fSPeter AvalosThe default is AUTH.
87856ea928SPeter Avalos.It Fl h
88856ea928SPeter AvalosDisplays
89856ea928SPeter Avalos.Nm
90856ea928SPeter Avalosusage information.
9118de8d7fSPeter Avalos.It Fl l Ar log_level
9218de8d7fSPeter AvalosSpecifies which messages will be logged by
9318de8d7fSPeter Avalos.Nm .
9418de8d7fSPeter AvalosThe possible values are:
9518de8d7fSPeter AvalosQUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
9618de8d7fSPeter AvalosINFO and VERBOSE log transactions that
9718de8d7fSPeter Avalos.Nm
9818de8d7fSPeter Avalosperforms on behalf of the client.
9918de8d7fSPeter AvalosDEBUG and DEBUG1 are equivalent.
10018de8d7fSPeter AvalosDEBUG2 and DEBUG3 each specify higher levels of debugging output.
10118de8d7fSPeter AvalosThe default is ERROR.
102*50a69bb5SSascha Wildner.It Fl P Ar denied_requests
103*50a69bb5SSascha WildnerSpecifies a comma-separated list of SFTP protocol requests that are banned by
10436e94dc5SPeter Avalosthe server.
10536e94dc5SPeter Avalos.Nm
106*50a69bb5SSascha Wildnerwill reply to any denied request with a failure.
10736e94dc5SPeter AvalosThe
10836e94dc5SPeter Avalos.Fl Q
10936e94dc5SPeter Avalosflag can be used to determine the supported request types.
110*50a69bb5SSascha WildnerIf both denied and allowed lists are specified, then the denied list is
111*50a69bb5SSascha Wildnerapplied before the allowed list.
112*50a69bb5SSascha Wildner.It Fl p Ar allowed_requests
113*50a69bb5SSascha WildnerSpecifies a comma-separated list of SFTP protocol requests that are permitted
11436e94dc5SPeter Avalosby the server.
115*50a69bb5SSascha WildnerAll request types that are not on the allowed list will be logged and replied
11636e94dc5SPeter Avalosto with a failure message.
11736e94dc5SPeter Avalos.Pp
11836e94dc5SPeter AvalosCare must be taken when using this feature to ensure that requests made
11936e94dc5SPeter Avalosimplicitly by SFTP clients are permitted.
12036e94dc5SPeter Avalos.It Fl Q Ar protocol_feature
121*50a69bb5SSascha WildnerQueries protocol features supported by
12236e94dc5SPeter Avalos.Nm .
12336e94dc5SPeter AvalosAt present the only feature that may be queried is
12436e94dc5SPeter Avalos.Dq requests ,
125*50a69bb5SSascha Wildnerwhich may be used to deny or allow specific requests (flags
12636e94dc5SPeter Avalos.Fl P
12736e94dc5SPeter Avalosand
12836e94dc5SPeter Avalos.Fl p
12936e94dc5SPeter Avalosrespectively).
130856ea928SPeter Avalos.It Fl R
131856ea928SPeter AvalosPlaces this instance of
132856ea928SPeter Avalos.Nm
133856ea928SPeter Avalosinto a read-only mode.
134856ea928SPeter AvalosAttempts to open files for writing, as well as other operations that change
135856ea928SPeter Avalosthe state of the filesystem, will be denied.
136856ea928SPeter Avalos.It Fl u Ar umask
137856ea928SPeter AvalosSets an explicit
138856ea928SPeter Avalos.Xr umask 2
139856ea928SPeter Avalosto be applied to newly-created files and directories, instead of the
140856ea928SPeter Avalosuser's default mask.
14118de8d7fSPeter Avalos.El
14218de8d7fSPeter Avalos.Pp
14336e94dc5SPeter AvalosOn some systems,
14418de8d7fSPeter Avalos.Nm
14518de8d7fSPeter Avalosmust be able to access
14636e94dc5SPeter Avalos.Pa /dev/log
14736e94dc5SPeter Avalosfor logging to work, and use of
14818de8d7fSPeter Avalos.Nm
14940c002afSPeter Avalosin a chroot configuration therefore requires that
15018de8d7fSPeter Avalos.Xr syslogd 8
15118de8d7fSPeter Avalosestablish a logging socket inside the chroot directory.
15218de8d7fSPeter Avalos.Sh SEE ALSO
15318de8d7fSPeter Avalos.Xr sftp 1 ,
15418de8d7fSPeter Avalos.Xr ssh 1 ,
15518de8d7fSPeter Avalos.Xr sshd_config 5 ,
15618de8d7fSPeter Avalos.Xr sshd 8
15718de8d7fSPeter Avalos.Rs
15818de8d7fSPeter Avalos.%A T. Ylonen
15918de8d7fSPeter Avalos.%A S. Lehtinen
16018de8d7fSPeter Avalos.%T "SSH File Transfer Protocol"
16136e94dc5SPeter Avalos.%N draft-ietf-secsh-filexfer-02.txt
16236e94dc5SPeter Avalos.%D October 2001
16318de8d7fSPeter Avalos.%O work in progress material
16418de8d7fSPeter Avalos.Re
16518de8d7fSPeter Avalos.Sh HISTORY
16618de8d7fSPeter Avalos.Nm
16718de8d7fSPeter Avalosfirst appeared in
16818de8d7fSPeter Avalos.Ox 2.8 .
16918de8d7fSPeter Avalos.Sh AUTHORS
17036e94dc5SPeter Avalos.An Markus Friedl Aq Mt markus@openbsd.org
171