setting current dir of remote shell

Darren Tucker dtucker at zip.com.au
Tue May 1 11:25:05 EST 2007


Bob Proulx wrote:
> Presently ssh (AFAICT) does not give a way to get to a
> POSIX shell on the remote machine.  ('ssh $HOST /bin/sh -c "cmd args"'
> almost works but requires an extra layer of shell quoting in the
> account's shell.)

It's not suitable for every purpose (eg if you need stdin on the command) but you 
can do:

ssh $HOST /bin/sh <<EOD
cmd args
EOD

which does not subject the command to the remote shell's quoting.

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.


More information about the openssh-unix-dev mailing list