From owner-freebsd-questions@FreeBSD.ORG Mon Nov 9 20:14:42 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 A90E41065670 for ; Mon, 9 Nov 2009 20:14:42 +0000 (UTC) (envelope-from sjk@ankeborg.nu) Received: from mail.three-dimensional.net (unknown [IPv6:2001:16d8:ffac:2::9]) by mx1.freebsd.org (Postfix) with ESMTP id 62F878FC1C for ; Mon, 9 Nov 2009 20:14:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.three-dimensional.net (Postfix) with ESMTP id F0CE8FB03A; Mon, 9 Nov 2009 21:14:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at three-dimensional.net Received: from mail.three-dimensional.net ([127.0.0.1]) by localhost (mail.three-dimensional.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 2QZguLtCAe+v; Mon, 9 Nov 2009 21:14:36 +0100 (CET) Received: from [192.168.20.3] (host-90-232-9-21.mobileonline.telia.com [90.232.9.21]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: sjk@ankeborg.nu) by mail.three-dimensional.net (Postfix) with ESMTPSA id 56120FB039; Mon, 9 Nov 2009 21:14:28 +0100 (CET) Mime-Version: 1.0 (Apple Message framework v1075.2) Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes From: Svante Kvarnstrom In-Reply-To: <4AF85FC9.10103@daleco.biz> Date: Mon, 9 Nov 2009 21:14:21 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: <4AF85FC9.10103@daleco.biz> To: Kevin Kinsey X-Mailer: Apple Mail (2.1075.2) Cc: freebsd-questions@freebsd.org 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 20:14:42 -0000 Hello Have you tried -f (for background) and -N for "Do not execute a remote =20= command"? See man 1 ssh for more details. Svante On Nov 9, 2009, at 7:30 PM, 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. The only issue is that I have to run it from > a terminal session. When I tried to bg the process ("cmdstring &") > it doesn't work, exactly. I'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. At 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. At 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. IIRC, 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.org=20 > " Best wishes, Svante J. Kvarnstr=F6m http://sjk.ankeborg.nu/ Mob.: +46 702 38 34 00