From owner-freebsd-questions@FreeBSD.ORG Sat Dec 27 21:31:35 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 1CB5C1065677 for ; Sat, 27 Dec 2008 21:31:35 +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 0A9558FC13 for ; Sat, 27 Dec 2008 21:31:35 +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 mBRLVYjc014502 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sat, 27 Dec 2008 13:31:34 -0800 (PST) (envelope-from admin2@enabled.com) Message-ID: <49569EB1.9050803@enabled.com> Date: Sat, 27 Dec 2008 13:31:29 -0800 From: Noah User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4955887F.1090704@enabled.com> In-Reply-To: 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:31:35 -0000 Christian Laursen 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/' > > Put something like the following in your ~/.ssh/config: > > Host otherhost > HostKeyAlias otherhost > ProxyCommand ssh noah@domain.com nc 192.168.1.20 22 > > Then you can simply run: > > ssh otherhost 'chown -R noah:noah /shares/internal/Music/' I cant do this since I need to reach a publicly addressable host before reaching the server at 192.168.1.20 > > > Reading the ssh_config man page might reveal a number of other nice > features ssh has to offer. >