On Sat, Mar 10, 2007 at 05:10:18AM -0800, agostonbejo wrote:
> By default when I ssh onto a machine, I arrive at the user's home directory.
> Can I somehow specify upon ssh'ing that I would like to arrive at a
> different one? 
> Something like this:
> 
> ssh -target-directory=~/local/mystuff [EMAIL PROTECTED]
> password: ...
> [EMAIL PROTECTED]:/local/mystuff # ...

ssh -t [EMAIL PROTECTED] 'cd ~/local/mystuff && exec bash'

Keep in mind that since you are no longer running a login shell, you
may not have the full set of environment variables you expect (since
your /etc/profile and ~/.{bash_,}profile won't be sourced).  You can
change that by forcing a login shell in the exec part.

If you don't use bash as your shell, substitute appropriately.

Reply via email to