From owner-freebsd-questions@FreeBSD.ORG Wed Aug 5 22:43:14 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE1F41065678 for ; Wed, 5 Aug 2009 22:43:14 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id 93BE18FC0A for ; Wed, 5 Aug 2009 22:43:14 +0000 (UTC) Received: from mr02.lnh.mail.rcn.net ([207.172.157.22]) by smtp02.lnh.mail.rcn.net with ESMTP; 05 Aug 2009 18:43:13 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr02.lnh.mail.rcn.net (MOS 3.10.6-GA) with ESMTP id QBW17668; Wed, 5 Aug 2009 18:42:34 -0400 (EDT) X-Auth-ID: roberthuff Received: from c-24-91-153-117.hsd1.ma.comcast.net (HELO [192.168.10.2]) ([24.91.153.117]) by smtp01.lnh.mail.rcn.net with ESMTP; 05 Aug 2009 18:42:35 -0400 Message-ID: <4A7A0AE0.9050403@rcn.com> Date: Wed, 05 Aug 2009 18:42:40 -0400 From: Robert Huff User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 CC: freebsd-questions@freebsd.org References: <4ad871310908051429q5d10f62bs8d9fff4f3a2d094e@mail.gmail.com> In-Reply-To: <4ad871310908051429q5d10f62bs8d9fff4f3a2d094e@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Junkmail-Whitelist: YES (by domain whitelist at mr02.lnh.mail.rcn.net) Subject: Re: sshd and dhcp bind to specific address X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Aug 2009 22:43:15 -0000 Glen Barber wrote: >> my pc gets ip address from dhcp server, >> but on my pc, there is running >> sshd. >> >> I want to make ssh to listen to only one >> ip address, but if ip changes due to dhcp, >> ssh server do not work properly. >> >> I know, that dhcp is able to assign ip address >> to client from some range e.g. 192.168.0.1-254 >> It is possible to do the same with ssh in case >> that it is not possible to do it only with one ip? >> > > Is this a local network, inside 192.168.0.0/24 ? Are you able to > configure a static IP for this machine? > > If not, I wrote a little script that runs every 15 minutes via cron(8) > which gets my IP address, performs a diff(1) against a static file > containing the current IP. If the IP is different, it mails me the > new IP. However, this assumes that outside access is the problem, > not internal access. I have a set of scripts I run when I know I have been handed a different address; they're not pretty, but they change the IP for sshd.conf and various stuff in bind. Robert Huff