If none of this works, put the following in .ssh/environment (or 
.ssh2/environment) on the remote host:

PATH=/usr/local/bin:/usr/bin:/bin

Of course PATH would be what you need to find scp.  My guess is that scp is in 
/usr/local/bin.  This is probably in your login scripts like .profile or 
/etc/profile.  The problem is, scp uses ssh in non-login mode, thus the shell is 
not a login shell and the path is not set properly.  The environment file solves 
this for you by making sure the PATH is set properly in these cases.  

To test my hypothesis, before creating the PATH entry in the environment file 
run:

        ssh remote_scp_host 'echo $PATH'
        
You will probably just see a very basic PATH without the dir that scp resides 
in.  Now create the environment file with a PATH entry and do it again.

OTOH, if you are running a shell like csh or bash that have individual command 
files per invocation, e.g. .cshrc or .bashrc, look in there and make sure the 
PATH is being set properly and not being reset to something minimal.  The above 
ssh ... above will help you track it down.

Hope this helps.

        --Dave

>X-Priority: 3 (Normal)
>Content-Transfer-Encoding: 8bit
>MIME-Version: 1.0
>Date: Thu, 17 May 2001 10:53:58 -0400 (EDT)
>From: "Carl J. Nobile" <[EMAIL PROTECTED]>
>To: Gerard Glas <[EMAIL PROTECTED]>
>Subject: RE: problem with scp
>Cc: "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
>
>Hi Gerard,
>
>Are you sure that the path to scp is in your PATH env var? Also if you
>are running a GUI then log out and back in again, depending on how the
>desktop is configured it might use a VC which will export it PATH env to
>all subsequent xterms, so you have to logout and maybe restart X also.
>Every time I've had this problem it been one or the other of these
>problems.
>
>Carl
>
>On 17-May-01 Gerard Glas wrote:
>> I try to do the following:
>> 
>> dexter:24% scp /tmp/test obelix:/tmp
>> gerard@obelix's password:
>> sh: scp: not found
>> lost connection
>> dexter:25%
>> 
>> Why I get always sh: scp: not found.
>> 
>> I did already a ./configure --with-default-path=/.....
>> no result.
>> Does anybody know?
>
>------------------------------------------------------------------------
>E-Mail: Carl J. Nobile <[EMAIL PROTECTED]>
>Date: 17-May-01                             Phone: 315-453-2912 Ex. 5336
>Time: 10:50:12                                Fax: 315-479-0859
>
>Software Engineering Group -- AppliedTheory Corp.
>224 Harrison Street, 6th Floor, Syracuse, NY  13202
>------------------------------------------------------------------------

--
David Knight French                           
Black Mountain Computer Consulting
Voice: (858)279-4862
Email: [EMAIL PROTECTED]

Reply via email to