setting current dir of remote shell

Darren Tucker dtucker at zip.com.au
Sat Apr 28 13:06:33 EST 2007


Dave Yost wrote:
> I assume you mean
> 
>   ssh -t someserver "cd $(pwd) && exec \$0 -l"
> 
> This works well enough that I've updated yostupload to use it.
> http://Yost.com/computers/yostupload
> 
> But is this the final word for ssh?

> Should there be a more formal
> facility that works for shells that don't support -l ?

I don't think so.  There's no mechanism in the protocol to explicitly
specify the working directory on the server.

There was one proposed on the IETF working group list but one problem is
it would allow a user with a restricted shell to bypass the restriction
on changing directories (and sshd has no reliable way of knowing a shell
is restricted and preventing it).

As Peter suggested you could use a "CWD" environment variable or similar
passed over the SSH connection but that would still have the same problem.

-- 
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