From owner-freebsd-questions@FreeBSD.ORG Sat Dec 27 15:41:23 2008 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 2CB941065721 for ; Sat, 27 Dec 2008 15:41:23 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: from mail5.sea5.speakeasy.net (mail5.sea5.speakeasy.net [69.17.117.7]) by mx1.freebsd.org (Postfix) with ESMTP id 0348A8FC14 for ; Sat, 27 Dec 2008 15:41:22 +0000 (UTC) (envelope-from freebsd-questions-local@be-well.ilk.org) Received: (qmail 4153 invoked from network); 27 Dec 2008 15:40:23 -0000 Received: from dsl092-078-145.bos1.dsl.speakeasy.net (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail5.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 27 Dec 2008 15:40:22 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.6]) by be-well.ilk.org (Postfix) with ESMTP id 0081250820; Sat, 27 Dec 2008 10:40:19 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id A1E5A1D10E; Sat, 27 Dec 2008 10:40:18 -0500 (EST) To: Noah References: <4955887F.1090704@enabled.com> From: Lowell Gilbert Date: Sat, 27 Dec 2008 10:40:18 -0500 In-Reply-To: <4955887F.1090704@enabled.com> (Noah's message of "Fri\, 26 Dec 2008 17\:44\:31 -0800") Message-ID: <44bpux7hjx.fsf@lowell-desk.lan> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: User Questions Subject: Re: running shell command through ssh tunnel X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: User Questions List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2008 15:41:23 -0000 Noah writes: > I am trying to run a shell command to the host at the far end of an ssh > tunnel. Here is how I structured access. Is there any way to do this > more compactly on one line? > > > ssh -L 12345:192.168.1.20:22 noah@domain.com > ssh -p 12345 localhost 'chown -R noah:noah /shares/internal/Music/' Maybe I haven't had enough coffee yet, but wouldn't that just be ssh noah@192.168.1.20 'chown -R noah:noah /shares/internal/Music/' ? You might even want to use '-n' as an option to the ssh command. -- Lowell Gilbert, embedded/networking software engineer, Boston area http://be-well.ilk.org/~lowell/