From owner-freebsd-questions@freebsd.org Sun May 20 17:35:53 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8239BEE7BBA; Sun, 20 May 2018 17:35:53 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E92F18745B; Sun, 20 May 2018 17:35:51 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w4KHZirV011849 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 20 May 2018 19:35:45 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: tech-lists@zyxst.net Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w4KHZdgl029139 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 21 May 2018 00:35:39 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: ftpd in base To: tech-lists , freebsd-questions@freebsd.org References: Cc: freebsd-stable@freebsd.org From: Eugene Grosbein Message-ID: <5B01B1E6.2090106@grosbein.net> Date: Mon, 21 May 2018 00:35:34 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 May 2018 17:35:53 -0000 20.05.2018 18:49, tech-lists wrote: > Hi, > > context: 11.2-BETA2 #0 r333924/amd64 > > I'm trying to get chrooted ftpd (in base) to write files uploaded to the user dir as mode 666 (umask 111). > I have a line in inetd.conf that looks like this: > > ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l -u 111 > > The user logs in OK and uploads OK but the perms are always 644. There is no login.conf overriding this. By default, there IS login class "default" in our /etc/login.conf with 0644 umask value. > The users shell is /usr/sbin/nologin as these are ftp-only accounts. This exact config works fine on linux (specifically ubuntu) > > Why is ftpd ignoring -u ? How can I fix? Our ftpd applies -u and by default instantly overrides it with login class setting. You should add your own login class to /etc/login.conf with 0111 value then run "cap_mkdb /etc/login.conf" and "pw usermod ftpusername -L ftploginclass"