2021-07-27 16:14:25 +02:00
|
|
|
.\" $OpenBSD: sftp-server.8,v 1.31 2021/07/27 14:14:25 jmc Exp $
|
2000-09-16 04:29:08 +02:00
|
|
|
.\"
|
2001-03-05 07:59:27 +01:00
|
|
|
.\" Copyright (c) 2000 Markus Friedl. All rights reserved.
|
2000-09-16 04:29:08 +02:00
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2021-07-27 16:14:25 +02:00
|
|
|
.Dd $Mdocdate: July 27 2021 $
|
2000-09-05 04:34:53 +02:00
|
|
|
.Dt SFTP-SERVER 8
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm sftp-server
|
2019-11-30 08:07:59 +01:00
|
|
|
.Nd OpenSSH SFTP server subsystem
|
2000-09-05 04:34:53 +02:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm sftp-server
|
2013-10-15 02:55:57 +02:00
|
|
|
.Bk -words
|
2010-01-09 12:24:33 +01:00
|
|
|
.Op Fl ehR
|
2013-01-09 05:57:36 +01:00
|
|
|
.Op Fl d Ar start_directory
|
2006-07-10 12:46:55 +02:00
|
|
|
.Op Fl f Ar log_facility
|
|
|
|
.Op Fl l Ar log_level
|
2020-06-22 07:53:26 +02:00
|
|
|
.Op Fl P Ar denied_requests
|
|
|
|
.Op Fl p Ar allowed_requests
|
2009-10-06 23:46:21 +02:00
|
|
|
.Op Fl u Ar umask
|
2013-10-15 02:55:57 +02:00
|
|
|
.Ek
|
|
|
|
.Nm
|
|
|
|
.Fl Q Ar protocol_feature
|
2000-09-05 04:34:53 +02:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
is a program that speaks the server side of SFTP protocol
|
|
|
|
to stdout and expects client requests from stdin.
|
|
|
|
.Nm
|
|
|
|
is not intended to be called directly, but from
|
2000-10-16 03:14:42 +02:00
|
|
|
.Xr sshd 8
|
2000-09-05 04:34:53 +02:00
|
|
|
using the
|
|
|
|
.Cm Subsystem
|
|
|
|
option.
|
2006-07-10 12:46:55 +02:00
|
|
|
.Pp
|
|
|
|
Command-line flags to
|
|
|
|
.Nm
|
|
|
|
should be specified in the
|
|
|
|
.Cm Subsystem
|
|
|
|
declaration.
|
2000-09-05 04:34:53 +02:00
|
|
|
See
|
2003-10-15 07:50:42 +02:00
|
|
|
.Xr sshd_config 5
|
2000-09-05 04:34:53 +02:00
|
|
|
for more information.
|
2006-07-10 12:46:55 +02:00
|
|
|
.Pp
|
|
|
|
Valid options are:
|
|
|
|
.Bl -tag -width Ds
|
2013-01-09 05:58:21 +01:00
|
|
|
.It Fl d Ar start_directory
|
2021-07-27 16:14:25 +02:00
|
|
|
Specifies an alternate starting directory for users.
|
2013-01-09 05:57:36 +01:00
|
|
|
The pathname may contain the following tokens that are expanded at runtime:
|
|
|
|
%% is replaced by a literal '%',
|
2014-12-11 05:16:14 +01:00
|
|
|
%d is replaced by the home directory of the user being authenticated,
|
2013-01-09 05:57:36 +01:00
|
|
|
and %u is replaced by the username of that user.
|
|
|
|
The default is to use the user's home directory.
|
|
|
|
This option is useful in conjunction with the
|
|
|
|
.Xr sshd_config 5
|
|
|
|
.Cm ChrootDirectory
|
|
|
|
option.
|
2009-10-06 23:47:47 +02:00
|
|
|
.It Fl e
|
|
|
|
Causes
|
|
|
|
.Nm
|
|
|
|
to print logging information to stderr instead of syslog for debugging.
|
2006-07-10 12:46:55 +02:00
|
|
|
.It Fl f Ar log_facility
|
|
|
|
Specifies the facility code that is used when logging messages from
|
|
|
|
.Nm .
|
|
|
|
The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
|
|
|
|
LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
|
|
|
|
The default is AUTH.
|
2009-10-06 23:47:47 +02:00
|
|
|
.It Fl h
|
|
|
|
Displays
|
|
|
|
.Nm
|
|
|
|
usage information.
|
2006-07-10 12:46:55 +02:00
|
|
|
.It Fl l Ar log_level
|
|
|
|
Specifies which messages will be logged by
|
|
|
|
.Nm .
|
|
|
|
The possible values are:
|
|
|
|
QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
|
|
|
|
INFO and VERBOSE log transactions that
|
|
|
|
.Nm
|
|
|
|
performs on behalf of the client.
|
|
|
|
DEBUG and DEBUG1 are equivalent.
|
|
|
|
DEBUG2 and DEBUG3 each specify higher levels of debugging output.
|
|
|
|
The default is ERROR.
|
2020-06-22 07:53:26 +02:00
|
|
|
.It Fl P Ar denied_requests
|
2021-07-27 16:14:25 +02:00
|
|
|
Specifies a comma-separated list of SFTP protocol requests that are banned by
|
2013-10-15 02:55:57 +02:00
|
|
|
the server.
|
|
|
|
.Nm
|
2020-06-22 07:53:26 +02:00
|
|
|
will reply to any denied request with a failure.
|
2013-10-15 02:55:57 +02:00
|
|
|
The
|
|
|
|
.Fl Q
|
2013-10-15 03:07:05 +02:00
|
|
|
flag can be used to determine the supported request types.
|
2020-06-22 07:53:26 +02:00
|
|
|
If both denied and allowed lists are specified, then the denied list is
|
|
|
|
applied before the allowed list.
|
|
|
|
.It Fl p Ar allowed_requests
|
2021-07-27 16:14:25 +02:00
|
|
|
Specifies a comma-separated list of SFTP protocol requests that are permitted
|
2013-10-15 02:55:57 +02:00
|
|
|
by the server.
|
2020-06-22 08:36:40 +02:00
|
|
|
All request types that are not on the allowed list will be logged and replied
|
2013-10-15 02:55:57 +02:00
|
|
|
to with a failure message.
|
|
|
|
.Pp
|
|
|
|
Care must be taken when using this feature to ensure that requests made
|
2013-10-15 03:07:05 +02:00
|
|
|
implicitly by SFTP clients are permitted.
|
2013-10-15 02:55:57 +02:00
|
|
|
.It Fl Q Ar protocol_feature
|
2021-07-27 16:14:25 +02:00
|
|
|
Queries protocol features supported by
|
2013-10-15 02:55:57 +02:00
|
|
|
.Nm .
|
|
|
|
At present the only feature that may be queried is
|
|
|
|
.Dq requests ,
|
2020-06-22 07:53:26 +02:00
|
|
|
which may be used to deny or allow specific requests (flags
|
2013-10-15 02:55:57 +02:00
|
|
|
.Fl P
|
2013-10-15 03:07:05 +02:00
|
|
|
and
|
|
|
|
.Fl p
|
|
|
|
respectively).
|
2010-01-09 12:24:33 +01:00
|
|
|
.It Fl R
|
|
|
|
Places this instance of
|
|
|
|
.Nm
|
|
|
|
into a read-only mode.
|
|
|
|
Attempts to open files for writing, as well as other operations that change
|
2010-01-09 12:25:46 +01:00
|
|
|
the state of the filesystem, will be denied.
|
2009-10-06 23:46:21 +02:00
|
|
|
.It Fl u Ar umask
|
|
|
|
Sets an explicit
|
|
|
|
.Xr umask 2
|
|
|
|
to be applied to newly-created files and directories, instead of the
|
|
|
|
user's default mask.
|
2006-07-10 12:46:55 +02:00
|
|
|
.El
|
2008-07-14 04:09:57 +02:00
|
|
|
.Pp
|
2014-07-30 04:33:20 +02:00
|
|
|
On some systems,
|
2008-07-14 04:09:57 +02:00
|
|
|
.Nm
|
|
|
|
must be able to access
|
2014-07-30 04:33:20 +02:00
|
|
|
.Pa /dev/log
|
|
|
|
for logging to work, and use of
|
2008-07-14 04:09:57 +02:00
|
|
|
.Nm
|
2009-06-21 09:52:27 +02:00
|
|
|
in a chroot configuration therefore requires that
|
2008-07-14 04:09:57 +02:00
|
|
|
.Xr syslogd 8
|
|
|
|
establish a logging socket inside the chroot directory.
|
2000-09-05 04:34:53 +02:00
|
|
|
.Sh SEE ALSO
|
2001-04-22 19:17:46 +02:00
|
|
|
.Xr sftp 1 ,
|
2000-09-05 04:34:53 +02:00
|
|
|
.Xr ssh 1 ,
|
2003-10-15 07:50:42 +02:00
|
|
|
.Xr sshd_config 5 ,
|
2000-10-16 03:14:42 +02:00
|
|
|
.Xr sshd 8
|
2001-04-22 19:17:46 +02:00
|
|
|
.Rs
|
2001-06-25 06:45:33 +02:00
|
|
|
.%A T. Ylonen
|
|
|
|
.%A S. Lehtinen
|
2001-04-22 19:17:46 +02:00
|
|
|
.%T "SSH File Transfer Protocol"
|
2013-05-16 12:24:23 +02:00
|
|
|
.%N draft-ietf-secsh-filexfer-02.txt
|
|
|
|
.%D October 2001
|
2001-04-22 19:17:46 +02:00
|
|
|
.%O work in progress material
|
|
|
|
.Re
|
2000-10-16 03:14:42 +02:00
|
|
|
.Sh HISTORY
|
|
|
|
.Nm
|
2006-09-26 12:14:28 +02:00
|
|
|
first appeared in
|
|
|
|
.Ox 2.8 .
|
|
|
|
.Sh AUTHORS
|
2013-07-18 08:14:13 +02:00
|
|
|
.An Markus Friedl Aq Mt markus@openbsd.org
|