From owner-freebsd-questions@FreeBSD.ORG Mon Nov 9 19:36:52 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 118DA1065694 for ; Mon, 9 Nov 2009 19:36:52 +0000 (UTC) (envelope-from gibblertron@gmail.com) Received: from mail-pz0-f202.google.com (mail-pz0-f202.google.com [209.85.222.202]) by mx1.freebsd.org (Postfix) with ESMTP id DCA408FC21 for ; Mon, 9 Nov 2009 19:36:51 +0000 (UTC) Received: by pzk40 with SMTP id 40so2262884pzk.7 for ; Mon, 09 Nov 2009 11:36:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Kzm2Kq5jZwunO2XjnfA7PRq86z44NE1vlbFtxYgLpIs=; b=cflZFDYEm1a162WFO1gI6y7aLXcmEr07GKyQUEHCClpVOE4UQcvmW5bMQQDbe0gdhS U2X9ZESYtHV8lJbh8sIbxaEfZlVxPn2IowYjZjKGhEqTZYGjZ8A2v6K1IzMUGiDaGJ0F vXlwKB3yJHhsYoBPC/lxkz92C8L/aHZPWNZSk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=QLmRyNMitOkSk3Fgfrh831cZZzf8Z9jWfRrKGOBxJYKrSzUHOegwyTsHazUBc0jpit 8vVKZEjJa1vLuy8GSC+sHuqZRMSbnu5lVGKRGsRmMD6gDBlQsAYIFht2vKj0uCL9sUTG PmiIg9F42RpUzontaSL8sOOngOXro6BKClKj8= MIME-Version: 1.0 Received: by 10.143.137.2 with SMTP id p2mr808527wfn.136.1257795411360; Mon, 09 Nov 2009 11:36:51 -0800 (PST) In-Reply-To: <4AF85FC9.10103@daleco.biz> References: <4AF85FC9.10103@daleco.biz> Date: Mon, 9 Nov 2009 11:36:51 -0800 Message-ID: From: patrick To: Kevin Kinsey Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions Subject: Re: Remote ssh tunnel in background or script? 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: Mon, 09 Nov 2009 19:36:52 -0000 Check out /usr/ports/security/autossh autossh is a program to start a copy of ssh and monitor it, restarting it as necessary should it die or stop passing traffic. The original idea and the mechanism were from rstunnel (Reliable SSH Tunnel). With this version the method changes: autossh uses ssh to construct a loop of ssh forwardings (one from local to remote, one from remote to local), and then sends test data that it expects to get back. (The idea is thanks to Terrence Martin.) WWW: http://www.harding.motd.ca/autossh/ Patrick On Mon, Nov 9, 2009 at 10:30 AM, Kevin Kinsey wrote: > Greetings! > > I have a client who recently dropped static IP service in > favor of a "cheaper" solution, so they're now on a DHCP network > blocking port 25, etc. > > In order to continue to allow them to connect to an outbound > SMTP box on the LAN, I've done this on their server: > > sudo ssh -L thisbox:24:remotebox:52525 me@remotebox > > I've got Sendmail listening there on 52525, and it works > fine; the local clients are told to connect to "thisbox" > port 24. =A0The only issue is that I have to run it from > a terminal session. =A0When I tried to bg the process ("cmdstring &") > it doesn't work, exactly. =A0I've gotten an error message > at times*, and at other times I apparently get "thisbox" > listening on port 24 but it's not an SMTP daemon that's > listening. > > I have a feeling it's cause I'm in csh, which is notorious > for backgrounding issues. =A0 =A0At any rate, what I'd > like to do is have a script set up the connection, or > write some daemon that would monitor the connection and > fix it if it gets reset. =A0At any rate, if I could get this > SSH process to detach from a terminal, it'd be great. > > Any suggestions? > > Kevin Kinsey > > * I'm sorry, but I can't reproduce the error message > this morning. =A0IIRC, something to the effect of > "I can't do nothing, give me a command please?" > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" >