From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bumble.maple.relay.mailchannels.net (bumble.maple.relay.mailchannels.net [23.83.214.25]) by sourceware.org (Postfix) with ESMTPS id D112638515EE for ; Mon, 28 Jun 2021 22:47:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D112638515EE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=optimation.com.au Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=optimation.com.au X-Sender-Id: netregistryptyltd|x-authuser|davido@optimation.com.au Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id E032E342724 for ; Mon, 28 Jun 2021 22:47:52 +0000 (UTC) Received: from awcp059.server-cpanel.com (100-98-55-130.trex-nlb.outbound.svc.cluster.local [100.98.55.130]) (Authenticated sender: netregistryptyltd) by relay.mailchannels.net (Postfix) with ESMTPA id 0DEAE343085 for ; Mon, 28 Jun 2021 22:47:51 +0000 (UTC) X-Sender-Id: netregistryptyltd|x-authuser|davido@optimation.com.au Received: from awcp059.server-cpanel.com (awcp059.server-cpanel.com [52.64.219.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.98.55.130 (trex/6.3.3); Mon, 28 Jun 2021 22:47:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: netregistryptyltd|x-authuser|davido@optimation.com.au X-MailChannels-Auth-Id: netregistryptyltd X-Irritate-Thread: 44c849dd0f9a94b0_1624920472527_3628622058 X-MC-Loop-Signature: 1624920472527:2361247286 X-MC-Ingress-Time: 1624920472526 Received: from localhost ([127.0.0.1]:38158 helo=awcp059.server-cpanel.com) by awcp059.server-cpanel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1ly02f-0007r4-An for cygwin@cygwin.com; Tue, 29 Jun 2021 08:47:50 +1000 Received: from [203.220.167.69] ([203.220.167.69]) by optimation.com.au (Horde Framework) with HTTPS; Tue, 29 Jun 2021 08:47:46 +1000 Date: Tue, 29 Jun 2021 08:47:46 +1000 Message-ID: <20210629084746.Horde.EOaX4JftYZgseWRQhFJQPhx@optimation.com.au> From: David Oppenheim To: cygwin@cygwin.com Subject: Difficult getting pure-ftpd to work under Cygwin on Windows 10, esp anonymous ftp User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AuthUser: davido@optimation.com.au X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_05, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Level: *** X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2021 22:47:57 -0000 I have debugged various obstacles getting logins to pure-ftpd to work under Cygwin on Windows 10 (Home edition 20H2 on this particular PC), especially getting anonymous ftp to login successfully. My pure-ftpd is version 1.0.46-1 as downloaded by the Cygwin installer. There are problems with how it looks up username/password, with it calling seteuid(), and sometimes with pathnames for the user's home directory, and the user's shell. This is particularly fraught if you try to use anonymous ftp. My solution is a simple recipe, albeit limited but fine for personal or small group use ... technical problem details after this recipe. I hope this helps anyone else trying to get it to work ! --- recipe for setting up pure-ftpd on Cygwin Set up pure-ftp passwd file first with pure-pw -f filename.passwd then convert to puredb format with pure-pw mkdb filename.pdb -f filename.passwd Note that sometimes pure-pw and/or pure-ftpd imply a /etc prefix for the filename, seems that's overridden if you use an absolute pathname. Run pure-ftpd as you. From the ftp client login as you with the puredb file password not the Windows password. Your starting directory once logged in will be the homne directory as set up in the puredb entry for your username ... probably /home/yourloginname (as viewed from inside Cygwin). --- end recipe Re anonymous login ... Internally pure-ftpd translates "anonymous" to "ftp" Anonymous login is not checked in the -l puredb file, it does a getpwnam() call, so "ftp" ** must ** be a user in Windows Needs /home/ftp (pathname from inside Cygwin) and perhaps ~/home/ftp for user running pure-ftpd For any ftp login, if the ftp username is not the same as the Windows user running pure-ftpd, pure-ftpd fails on seteuid() ... see Windows event logger (or Cygwin syslog if that's installed), the ftp client sees "Unable to set up secure anonymous FTP" This happens even if running pure-ftpd from Explorer by "Run as Administrator" So for anonymous login you have to run pure-ftpd as Windows user ftp More generally, because of that seteuid issue, if you want to ftp login as uuu then you need to run pure-ftpd as Windows user uuu ... although having uuu in a pure-pw database permits the password to be different from the Windows login password. Nb: if you run pure-ftpd directly from Explorer (incl "Run as Administrator") the place it looks for the home directory may be ./ or the Windows user's home (C:\Users\uuu) and I have also seen failures setting user shell because it's looking for e.g. /bin/bash somewhere else.