How to ssh and cd to the current directory?



ssh by default only goes to the home directory ~. I'm wondering if
there is a way to supply a directory (that is /home/name/some_dir in
this case) to it, so that it will go to the directory directly.

$pwd
/home/name/some_dir
$ssh localhost # I want to change the directory to /home/name/some_dir
after sshed to localhost
$pwd
/home/name
.



Relevant Pages

  • Re: ssh and remembering the source dir
    ... It would be nice if after ssh from base ... and in your.profile, .bashrc, or other initialisation script, ... you may find $PWD doesn't track the current directory. ... using *csh shells then the aliasing will be slightly different. ...
    (comp.os.linux.misc)
  • Re: remote ssh not closing after X program run
    ... > machine using ssh. ... > out from the remote machine, ... when doing a su, you will get the root and it's pwd, but when exit from the su ... you still have root and it's last pwd in the xterm title. ...
    (comp.security.ssh)
  • Re: remote ssh not closing after X program run
    ... > machine using ssh. ... > out from the remote machine, ... when doing a su, you will get the root and it's pwd, but when exit from the su ... you still have root and it's last pwd in the xterm title. ...
    (alt.os.linux)
  • Re: Interactive App over Telnet
    ... you might also investigate using ssh vs. telnet - unless you don't care if your pwd is passed in clear text. ...
    (comp.lang.perl.misc)
  • Re: why can I write to a file I dont own??
    ... Don't override vi's decision when it tells you that you are ... > # pwd ... So I presume /home/test_dir is user7's home directory ... And presumably vi told you it was a readonly file. ...
    (RedHat)