From owner-freebsd-questions@FreeBSD.ORG Sat Dec 27 21:33:11 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 7E637106564A for ; Sat, 27 Dec 2008 21:33:11 +0000 (UTC) (envelope-from admin2@enabled.com) Received: from typhoon.enabled.com (typhoon.enabled.com [216.218.220.21]) by mx1.freebsd.org (Postfix) with ESMTP id 6C91C8FC19 for ; Sat, 27 Dec 2008 21:33:11 +0000 (UTC) (envelope-from admin2@enabled.com) Received: from [172.23.0.135] (nat-service4.juniper.net [66.129.225.151]) (authenticated bits=0) by typhoon.enabled.com (8.14.3/8.14.3) with ESMTP id mBRLXBJL014544 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 27 Dec 2008 13:33:11 -0800 (PST) (envelope-from admin2@enabled.com) Message-ID: <49569F12.5070504@enabled.com> Date: Sat, 27 Dec 2008 13:33:06 -0800 From: Noah User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: User Questions References: <4955887F.1090704@enabled.com> <44bpux7hjx.fsf@lowell-desk.lan> In-Reply-To: <44bpux7hjx.fsf@lowell-desk.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: running shell command through ssh tunnel 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: Sat, 27 Dec 2008 21:33:11 -0000 Lowell Gilbert wrote: > 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. I cant do this since I need to reach a publicly addressable host before reaching the server at 192.168.1.20 . Therefore I am under the impression I need to tunnel through the publicly addressed host first then I can ssh to 192.168.1.20 .