[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: login into a particular directory using ssh



On Sun, 5 Dec 2004 23:28:07 +0100, Maurits van Rees <maurits@vanrees.org> wrote:
> On Sun, Dec 05, 2004 at 05:18:54PM -0500, David Mandelberg wrote:
> > ssh user@hostname "sh -c 'cd dirname; exec somecommand'"
> >
> > somecommand is the command you want to run after cd'ing. E.g. if you
> > want to run bash in / as joe at shell.example.net:
> >
> > ssh joe@shell.example.net "sh -c 'cd /; exec bash'"
> 
> Alternatively, if you *always* want to start in that directory, you
> can edit the .bash_profile or similar on the remote machine. Just add
> `cd <some directory>'.
> 

No, I want this to happen only when I ssh. If i edit the bash_profile,
then everytime I open a window/shell, it gets executed. That is not
what I want.

raju

-- 
Kamaraju S Kusumanchi
Cornell University
http://people.cornell.edu/pages/kk288/
http://groups.yahoo.com/group/flumech/



Reply to: