Re: login into a particular directory using ssh

2004-12-06 Thread Dave Thayer
On Sun, Dec 05, 2004 at 05:35:59PM -0500, Kamaraju Kusumanchi wrote: > On Sun, 5 Dec 2004 23:28:07 +0100, Maurits van Rees <[EMAIL PROTECTED]> wrote: > > On Sun, Dec 05, 2004 at 05:18:54PM -0500, David Mandelberg wrote: > > > ssh [EMAIL PROTECTED] "sh -c 'cd dirname; exec somecommand'" > > > > > >

Re: login into a particular directory using ssh

2004-12-06 Thread Kamaraju Kusumanchi
> If your home directory has a different path on the two machines, try this: > > DYNAMIC=${PWD#$HOME/} > ssh -t [EMAIL PROTECTED] "cd $DYNAMIC ; exec /bin/bash --login -i" > > This should plunk you in the corresponding directory on the remote host, > whether you're in $HOME/foo or /usr/bin.

Re: login into a particular directory using ssh

2004-12-05 Thread Sam Watkins
On Sun, Dec 05, 2004 at 08:19:04PM -0500, Kamaraju Kusumanchi wrote: > bash$export DYNAMIC=$(basename $PWD) > bash$ssh -t [EMAIL PROTECTED] 'cd $DYNAMIC && exec /bin/bash --login -i' how about: ssh -t [EMAIL PROTECTED] "cd $PWD ; exec /bin/bash --login -i" I don't know what you were using base

Re: login into a particular directory using ssh

2004-12-05 Thread David Jardine
On Sun, Dec 05, 2004 at 08:19:04PM -0500, Kamaraju Kusumanchi wrote: > On Sun, 05 Dec 2004 18:48:19 -0500, David Mandelberg > <[EMAIL PROTECTED]> wrote: > > Miquel van Smoorenburg wrote: > > > ssh -t [EMAIL PROTECTED] 'cd / && exec /bin/bash' > > > > That works, but because this is a login s

Re: login into a particular directory using ssh

2004-12-05 Thread Kamaraju Kusumanchi
On Sun, 05 Dec 2004 18:48:19 -0500, David Mandelberg <[EMAIL PROTECTED]> wrote: > Miquel van Smoorenburg wrote: > > ssh -t [EMAIL PROTECTED] 'cd / && exec /bin/bash' > > That works, but because this is a login shell, and the remote machine > may differentiate between login and non-login shel

Re: login into a particular directory using ssh

2004-12-05 Thread David Mandelberg
Miquel van Smoorenburg wrote: > ssh -t [EMAIL PROTECTED] 'cd / && exec /bin/bash' That works, but because this is a login shell, and the remote machine may differentiate between login and non-login shells, this is better: ssh -t [EMAIL PROTECTED] 'cd / && exec /bin/bash --login -i' Also do

Re: login into a particular directory using ssh

2004-12-05 Thread Miquel van Smoorenburg
In article <[EMAIL PROTECTED]>, Kamaraju Kusumanchi <[EMAIL PROTECTED]> wrote: >On Sun, 05 Dec 2004 17:18:54 -0500, David Mandelberg ><[EMAIL PROTECTED]> wrote: >> ssh [EMAIL PROTECTED] "sh -c 'cd dirname; exec somecommand'" >> >> somecommand is the command you want to run after cd'ing. E.g. if y

Re: login into a particular directory using ssh

2004-12-05 Thread Maurits van Rees
On Sun, Dec 05, 2004 at 05:33:14PM -0500, Kamaraju Kusumanchi wrote: > On Sun, 05 Dec 2004 17:18:54 -0500, David Mandelberg > <[EMAIL PROTECTED]> wrote: > > ssh [EMAIL PROTECTED] "sh -c 'cd dirname; exec somecommand'" > > > > somecommand is the command you want to run after cd'ing. E.g. if you > >

Re: login into a particular directory using ssh

2004-12-05 Thread David Mandelberg
Did you remember to use your own login name and hostname instead of [EMAIL PROTECTED] Is sshd working correctly on the remote computer? Is a firewall blocking ssh? Are you using an sh-compatible (i.e. sh, ksh, bash, zsh, ...) shell on both computers? I can't think of any other reasons that it would

Re: login into a particular directory using ssh

2004-12-05 Thread Kamaraju Kusumanchi
On Sun, 5 Dec 2004 23:28:07 +0100, Maurits van Rees <[EMAIL PROTECTED]> wrote: > On Sun, Dec 05, 2004 at 05:18:54PM -0500, David Mandelberg wrote: > > ssh [EMAIL PROTECTED] "sh -c 'cd dirname; exec somecommand'" > > > > somecommand is the command you want to run after cd'ing. E.g. if you > > want t

Re: login into a particular directory using ssh

2004-12-05 Thread Kamaraju Kusumanchi
On Sun, 05 Dec 2004 17:18:54 -0500, David Mandelberg <[EMAIL PROTECTED]> wrote: > ssh [EMAIL PROTECTED] "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 [EMAIL PROTECTED] "s

Re: login into a particular directory using ssh

2004-12-05 Thread Maurits van Rees
On Sun, Dec 05, 2004 at 05:18:54PM -0500, David Mandelberg wrote: > ssh [EMAIL PROTECTED] "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 [EMAIL PROTECTED] "sh -c 'cd /; ex

Re: login into a particular directory using ssh

2004-12-05 Thread David Mandelberg
ssh [EMAIL PROTECTED] "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 [EMAIL PROTECTED] "sh -c 'cd /; exec bash'" Kamaraju Kusumanchi wrote: > I am trying to ssh from A to B. I want

login into a particular directory using ssh

2004-12-05 Thread Kamaraju Kusumanchi
I am trying to ssh from A to B. I want to login into a particular directory on B instead of $HOME. How can I do this? I tried ssh [EMAIL PROTECTED] cd dirname but that is not working. Any other ideas? thanks raju -- Kamaraju S Kusumanchi Cornell University http://people.cornell.edu/pages/kk28