running shell command through ssh tunnel

Lowell Gilbert freebsd-questions-local at
Sat Dec 27 15:41:23 UTC 2008

Noah <admin2 at> 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: noah at
> 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 at '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

More information about the freebsd-questions mailing list