From owner-freebsd-questions@FreeBSD.ORG Mon Jul 28 10:42:49 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A15DA37B401 for ; Mon, 28 Jul 2003 10:42:49 -0700 (PDT) Received: from rwcrmhc11.comcast.net (rwcrmhc11.comcast.net [204.127.198.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id EB94643F3F for ; Mon, 28 Jul 2003 10:42:46 -0700 (PDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: from be-well.ilk.org (be-well.no-ip.com[66.30.200.37]) by comcast.net (rwcrmhc11) with ESMTP id <2003072817424601300oqi3ke>; Mon, 28 Jul 2003 17:42:46 +0000 Received: from be-well.ilk.org (lowellg.ne.client2.attbi.com [66.30.200.37] (may be forged)) by be-well.ilk.org (8.12.9/8.12.9) with ESMTP id h6SHgdM1017335 for ; Mon, 28 Jul 2003 13:42:39 -0400 (EDT) (envelope-from freebsd-questions-local@be-well.no-ip.com) Received: (from lowell@localhost) by be-well.ilk.org (8.12.9/8.12.6/Submit) id h6SHgZ60017332; Mon, 28 Jul 2003 13:42:35 -0400 (EDT) X-Authentication-Warning: be-well.ilk.org: lowell set sender to freebsd-questions-local@be-well.ilk.org using -f Sender: lowell@be-well.no-ip.com To: freebsd-questions@freebsd.org References: <20030726140615.15625.qmail@web40605.mail.yahoo.com> From: Lowell Gilbert Date: 28 Jul 2003 13:42:34 -0400 In-Reply-To: <20030726140615.15625.qmail@web40605.mail.yahoo.com> Message-ID: <44fzkqh7jp.fsf@be-well.ilk.org> Lines: 80 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: configure ftpd port range X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jul 2003 17:42:50 -0000 John DeStefano writes: > > Lowell Gilbert > wrote: > Thanks for your response, Lowell, as always. > > John DeStefano writes: > >> Due to ISP restrictions, I must change the default port on which > ftpd > >> runs in order to enable ftp access to and from my machine. > > > That would violate the FTP spec, and isn't supported (IIRC) by the > > standard FreeBSD ftpd. > > Obviously, I'm not looking to 'violate' any specs, or to have any > RFCs changed in order to accomodate my personal server. I'm just > looking for a viable solution to a problem that I'm sure others have > come across. NAT is very unfriendly to the FTP protocol (in fact, firewalling isn't especially nice about it either), so it's always painful to do what you want. If it's strictly for personal use, scp is a lot easier to get running under those configurations, and loads more secure to boot. > >> I had to do the same for my httpd server, but that information was a > >> bit more accessible. > >> Reading material has been sparse, but I've read that adding a port > >> number/range to the ftpd entry /etc/services and /etc/inetd.conf > might > >> do the trick. > >> Is this an acceptible way of going about changing the ftp ports? > > > It won't work. > > Why not? If you were to specify a new port number both in 'services' > and 'inetd.conf', and the proper firewall holes were punched, why would > it fail? Because ftpd doesn't consult those files for opening up its ports. Because the port numbers are hard-coded in the spec, they're hard-coded in the server as well. > Strangely enough, it sounds like moving away from the stock ftpd, > and using a 3PP daemon to configure the new ports, is the way to go. > Any suggestions on ports and methods? Sorry, I don't run *any* FTP any more. > >> Quick sidebar: DNS is setting my domainname to my ISP's domain, > >> not my local domain, which is causing some problems. "man > >> domainname" tells me " The super-user can set the domain name by > >> supplying an argument", which I assume means "domainname > >> ". But this setting does not stick on reboot. Is there an > >> easy fix? > > According to the FreeBSD Handbook, the FreeBSD FAQ, and the > rc.conf(5) > > manual, setting "hostname" in /etc/rc.conf is what you're looking > for. > > The handbook merely specifies to use the format: > hostname="foo.example.com" > in rc.conf; it doesn't say what to do when the system automatically > changes the hostname on you on boot/reboot, presumably due to DHCP > communications. I could be mistaken, but I don't see this topic in the > FAQ (which currently covers up to 4.X) at all. 'man' says: > "If dhclient(8) is used to set the hostname via DHCP, this variable > should be set to an empty string." However, I believe that's what's > happening now and may be the reason why 'hostname' is getting reset > incorrectly; see below: > > # cat /etc/rc.conf |grep hostname > #hostname="gandalf.istari" > hostname="gandalf" > hostname="gandalf.Optonline.net" > > My manual entry has been commented out, and new entries made. How > would > one keep this from getting changed automatically? Hmm. You'd have to look at why that was happening. I don't know offhand, and I can't really experiment with it at the moment.