From owner-freebsd-questions@FreeBSD.ORG Mon Nov 9 19:06:06 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 A7392106568F for ; Mon, 9 Nov 2009 19:06:06 +0000 (UTC) (envelope-from adrien.fontaine@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by mx1.freebsd.org (Postfix) with ESMTP id 393378FC0A for ; Mon, 9 Nov 2009 19:06:05 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id d23so1428962fga.13 for ; Mon, 09 Nov 2009 11:06:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=U2tgrmDpmBSo2WU6/CJuJlEt+WYMBvk1OD/H5dgnAyQ=; b=XNL+XAZwZL3eQ+5kB7siRrLudlxo5rKtTc3bqA03reZsHDbAZ1ra67Jwh6TmPyL++u 8QlduxBPuX3jYznqfZq69TtI8qilUpLqa/d/jobW8e7FkHl1jurG786XIZC4z3NsQuZ6 s4Hw0Y57rTdxfhr/i1avKU0aQ3xAJhNm/Cmsw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=aFJKueGCYz/+LCFtZh01OS08U/Ommh0Mi4p6KIzTv1OP4Ffz7PuClTXjQxc3/x71l7 nWFtLaHoCGBwPMuM3mBGFpmIP5x3VIx/lDhs5Qs9kUHeS0tCeuKR5C5Lng0MZECv1JGv BeqB1+NfqOJDRzYIqktgUWMU5MN/twh9mbX0c= Received: by 10.86.108.19 with SMTP id g19mr4697494fgc.16.1257792065934; Mon, 09 Nov 2009 10:41:05 -0800 (PST) Received: from ?192.168.0.11? (lns-bzn-49f-81-56-167-53.adsl.proxad.net [81.56.167.53]) by mx.google.com with ESMTPS id 3sm7417243fge.9.2009.11.09.10.41.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 09 Nov 2009 10:41:04 -0800 (PST) Message-ID: <4AF8623D.9070801@gmail.com> Date: Mon, 09 Nov 2009 19:41:01 +0100 From: adrienfirst User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4AF85FC9.10103@daleco.biz> In-Reply-To: <4AF85FC9.10103@daleco.biz> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit 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:06:06 -0000 Kevin Kinsey a écrit : > 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" Try screen ( /usr/ports/sysutils/screen ) screen -S to run the session Ctrl-a Ctrl-z to get out of this session and let it run in background screen -r to return in this session.