xref: /dflybsd-src/libexec/ftpd/ftpchroot.5 (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn Marino.\" Copyright (c) 2003 FreeBSD Project
2*86d7f5d3SJohn Marino.\" All rights reserved.
3*86d7f5d3SJohn Marino.\"
4*86d7f5d3SJohn Marino.\" Redistribution and use in source and binary forms, with or without
5*86d7f5d3SJohn Marino.\" modification, are permitted provided that the following conditions
6*86d7f5d3SJohn Marino.\" are met:
7*86d7f5d3SJohn Marino.\" 1. Redistributions of source code must retain the above copyright
8*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer.
9*86d7f5d3SJohn Marino.\" 2. Redistributions in binary form must reproduce the above copyright
10*86d7f5d3SJohn Marino.\"    notice, this list of conditions and the following disclaimer in the
11*86d7f5d3SJohn Marino.\"    documentation and/or other materials provided with the distribution.
12*86d7f5d3SJohn Marino.\"
13*86d7f5d3SJohn Marino.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*86d7f5d3SJohn Marino.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*86d7f5d3SJohn Marino.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*86d7f5d3SJohn Marino.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*86d7f5d3SJohn Marino.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*86d7f5d3SJohn Marino.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*86d7f5d3SJohn Marino.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*86d7f5d3SJohn Marino.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*86d7f5d3SJohn Marino.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*86d7f5d3SJohn Marino.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*86d7f5d3SJohn Marino.\" SUCH DAMAGE.
24*86d7f5d3SJohn Marino.\"
25*86d7f5d3SJohn Marino.\" $FreeBSD: src/libexec/ftpd/ftpchroot.5,v 1.3 2003/06/01 19:52:36 ru Exp $
26*86d7f5d3SJohn Marino.\" $DragonFly: src/libexec/ftpd/ftpchroot.5,v 1.4 2007/05/17 08:19:01 swildner Exp $
27*86d7f5d3SJohn Marino.\"
28*86d7f5d3SJohn Marino.Dd January 26, 2003
29*86d7f5d3SJohn Marino.Dt FTPCHROOT 5
30*86d7f5d3SJohn Marino.Os
31*86d7f5d3SJohn Marino.Sh NAME
32*86d7f5d3SJohn Marino.Nm ftpchroot
33*86d7f5d3SJohn Marino.Nd "list users and groups subject to FTP access restrictions"
34*86d7f5d3SJohn Marino.Sh DESCRIPTION
35*86d7f5d3SJohn MarinoThe file
36*86d7f5d3SJohn Marino.Nm
37*86d7f5d3SJohn Marinois read by
38*86d7f5d3SJohn Marino.Xr ftpd 8
39*86d7f5d3SJohn Marinoat the beginning of an FTP session, after having authenticated the user.
40*86d7f5d3SJohn MarinoEach line in
41*86d7f5d3SJohn Marino.Nm
42*86d7f5d3SJohn Marinocorresponds to a user or group.
43*86d7f5d3SJohn MarinoIf a line in
44*86d7f5d3SJohn Marino.Nm
45*86d7f5d3SJohn Marinomatches the current user or a group he is a member of,
46*86d7f5d3SJohn Marinoaccess restrictions will be applied to this
47*86d7f5d3SJohn Marinosession by changing its root directory with
48*86d7f5d3SJohn Marino.Xr chroot 2
49*86d7f5d3SJohn Marinoto that specified on the line or to the user's login directory.
50*86d7f5d3SJohn Marino.Pp
51*86d7f5d3SJohn MarinoThe order of records in
52*86d7f5d3SJohn Marino.Nm
53*86d7f5d3SJohn Marinois important because the first match will be used.
54*86d7f5d3SJohn MarinoFields on each line are separated by tabs or spaces.
55*86d7f5d3SJohn Marino.Pp
56*86d7f5d3SJohn MarinoThe first field specifies a user or group name.
57*86d7f5d3SJohn MarinoIf it is prefixed by an
58*86d7f5d3SJohn Marino.Dq at
59*86d7f5d3SJohn Marinosign,
60*86d7f5d3SJohn Marino.Ql @ ,
61*86d7f5d3SJohn Marinoit specifies a group name;
62*86d7f5d3SJohn Marinothe line will match each user who is a member of this group.
63*86d7f5d3SJohn MarinoAs a special case, a single
64*86d7f5d3SJohn Marino.Ql @
65*86d7f5d3SJohn Marinoin this field will match any user.
66*86d7f5d3SJohn MarinoA username is specified otherwise.
67*86d7f5d3SJohn Marino.Pp
68*86d7f5d3SJohn MarinoThe optional second field describes the directory for the user
69*86d7f5d3SJohn Marinoor each member of the group to be locked up in using
70*86d7f5d3SJohn Marino.Xr chroot 2 .
71*86d7f5d3SJohn MarinoBe it omitted, the user's login directory will be used.
72*86d7f5d3SJohn MarinoIf it is not an absolute pathname, then it will be relative
73*86d7f5d3SJohn Marinoto the user's login directory.
74*86d7f5d3SJohn MarinoIf it contains the
75*86d7f5d3SJohn Marino.Pa /./
76*86d7f5d3SJohn Marinoseparator,
77*86d7f5d3SJohn Marino.Xr ftpd 8
78*86d7f5d3SJohn Marinowill treat its left-hand side as the name of the directory to do
79*86d7f5d3SJohn Marino.Xr chroot 2
80*86d7f5d3SJohn Marinoto, and its right-hand side to change the current directory to afterwards.
81*86d7f5d3SJohn Marino.Sh FILES
82*86d7f5d3SJohn Marino.Bl -tag -width ".Pa /etc/ftpchroot" -compact
83*86d7f5d3SJohn Marino.It Pa /etc/ftpchroot
84*86d7f5d3SJohn Marino.El
85*86d7f5d3SJohn Marino.Sh EXAMPLES
86*86d7f5d3SJohn MarinoThese lines in
87*86d7f5d3SJohn Marino.Nm
88*86d7f5d3SJohn Marinowill lock up the user
89*86d7f5d3SJohn Marino.Dq Li webuser
90*86d7f5d3SJohn Marinoand each member of the group
91*86d7f5d3SJohn Marino.Dq Li hostee
92*86d7f5d3SJohn Marinoin their respective login directories:
93*86d7f5d3SJohn Marino.Bd -literal -offset indent
94*86d7f5d3SJohn Marinowebuser
95*86d7f5d3SJohn Marino@hostee
96*86d7f5d3SJohn Marino.Ed
97*86d7f5d3SJohn Marino.Pp
98*86d7f5d3SJohn MarinoAnd this line will tell
99*86d7f5d3SJohn Marino.Xr ftpd 8
100*86d7f5d3SJohn Marinoto lock up the user
101*86d7f5d3SJohn Marino.Dq Li joe
102*86d7f5d3SJohn Marinoin
103*86d7f5d3SJohn Marino.Pa /var/spool/ftp
104*86d7f5d3SJohn Marinoand then to change the current directory to
105*86d7f5d3SJohn Marino.Pa /joe ,
106*86d7f5d3SJohn Marinowhich is relative to the session's new root:
107*86d7f5d3SJohn Marino.Pp
108*86d7f5d3SJohn Marino.Dl "joe	/var/spool/ftp/./joe"
109*86d7f5d3SJohn Marino.Pp
110*86d7f5d3SJohn MarinoAnd finally the following line will lock up every user connecting
111*86d7f5d3SJohn Marinothrough FTP in his respective
112*86d7f5d3SJohn Marino.Pa ~/public_html ,
113*86d7f5d3SJohn Marinothus lowering possible impact on the system
114*86d7f5d3SJohn Marinofrom intrinsic insecurity of FTP:
115*86d7f5d3SJohn Marino.Pp
116*86d7f5d3SJohn Marino.Dl "@	public_html"
117*86d7f5d3SJohn Marino.Sh SEE ALSO
118*86d7f5d3SJohn Marino.Xr chroot 2 ,
119*86d7f5d3SJohn Marino.Xr group 5 ,
120*86d7f5d3SJohn Marino.Xr passwd 5 ,
121*86d7f5d3SJohn Marino.Xr ftpd 8
122