Mailing List Archive

bash: scp: command not found
How come I can't get scp to work properly. It just complains like this:

scp foo host:
bash: scp: command not found
lost connection


===========================================================
Harald H Hannelius | Harald@iki.fi | GSM +358405470870
===========================================================
Re: bash: scp: command not found [ In reply to ]
On Wed, 2 Feb 2000, Harald@iki.fi wrote:

> How come I can't get scp to work properly. It just complains like this:
>
> scp foo host:
> bash: scp: command not found
> lost connection

Maybe you should check for the path on the remote machine: it seems like
the remote shell can't find scp in its $PATH.

--
Dominik - http://www.saargate.de/~domi/
Re: bash: scp: command not found [ In reply to ]
Yo Harald!

It sounds like the sshd on the remote end can not find it's copy
of scp. Check the path that is complied into the remote sshd.

RGDS
GARY

On Wed, 2 Feb 2000, Harald Hannelius wrote:

> Date: Wed, 2 Feb 2000 22:01:44 +0200 (EET)
> From: Harald Hannelius <Harald@iki.fi>
> To: openssh-unix-dev@mindrot.org
> Subject: bash: scp: command not found
>
>
> How come I can't get scp to work properly. It just complains like this:
>
> scp foo host:
> bash: scp: command not found
> lost connection
>
>
> ===========================================================
> Harald H Hannelius | Harald@iki.fi | GSM +358405470870
> ===========================================================
>
>
>

---------------------------------------------------------------------------
Gary E. Miller Rellim 20340 Empire Ave, Suite E-3, Bend, OR 97701
gem@rellim.com Tel:+1(541)382-8588 Fax: +1(541)382-8676
Re: bash: scp: command not found [ In reply to ]
-----BEGIN PGP SIGNED MESSAGE-----

On Wed, 2 Feb 2000, Harald Hannelius wrote:

>
> How come I can't get scp to work properly. It just complains like this:
>
> scp foo host:
> bash: scp: command not found
> lost connection

i ran into this problem when i installed ssh in /usr/local/bin
on our network. Apparently bash doesn't have /usr/local/bin in it's
compiled in path, and it doesn't source /etc/profile. According to the
bash man page:

"When an interactive shell that is not a login shell is
started, bash reads and executes commands from ~/.bashrc,
if that file exists."

Apparently, scp is considered a non-login interactive shell that invokes
bash. A couple of solutions:

1. Make each user add /usr/local/bin (or wherever scp is) to their path in
their ~/.bashrc

2. Recompile bash to have /usr/local/bin (or wherever scp is) in the
default path.

3. Add an option to ssh to pass a path to the shell (i've seen this in
commercial ssh-1.2.27 as --with-path). And then recompile it.

4. Put scp and ssh somewhere in bash's default path (which from my
experience appears to be /usr/bin:/bin:/usr/sbin:/sbin).

Systems Programmer - Nathan Paul Simons
http://www.nmt.edu/~enigma Speare 20 x5748

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBOJiQdIagi6ObDYzdAQFhVgP8Cp/Liqg7uAWemKZTsfx4prn6suERDTTd
7hphgIebuDpy5HsRbBQlE7wPzkvgwr8KA6sgfmgTp2XPkKzkJIvt+KJKzrwwMp62
7PWOb0mAchx6LK8MT6n2JNv0Ovvn2HlumOY1XyV1XvB3Z/Lq1+uWYz0rxfC+OWYz
+BzT4BmjsBM=
=8iY9
-----END PGP SIGNATURE-----
Re: bash: scp: command not found [ In reply to ]
A much simpler workaround is to create this symbolic link:

# ln -s /usr/local/bin/scp /usr/bin

This is how I fixed the problem here (Debian slink, 2.2.14 kernel).

Phil
Re: bash: scp: command not found [ In reply to ]
On Wed, 2 Feb 2000, Harald Hannelius wrote:

>
> How come I can't get scp to work properly. It just complains like this:
>
> scp foo host:
> bash: scp: command not found
> lost connection

scp must be in the server's PATH.

Damien

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
Re: bash: scp: command not found [ In reply to ]
>>>>> "Dominik" == Dominik Brettnacher <domi@saargate.de> writes:

Dominik> On Wed, 2 Feb 2000, Harald@iki.fi wrote:
>> How come I can't get scp to work properly. It just complains
>> like this:
>>
>> scp foo host: bash: scp: command not found lost connection

Dominik> Maybe you should check for the path on the remote
Dominik> machine: it seems like the remote shell can't find scp in
Dominik> its $PATH.

Or the "more SSH" way would be to put

PATH=<a path including scp and probably your normal stuff>

in ~/.ssh/environment on the machine being scp'ed to.

--
Email: cb@v-wave.com | UNIX Support
Email: Chris.Bayly@UAlberta.CA | 151 General Services Building
| University of Alberta
| Edmonton, Alberta
Web: http://www.thegeeks.net/~cb/ | Canada T6G 2S7
Re: bash: scp: command not found [ In reply to ]
On Wed, 2 Feb 2000 13:15:45 -0700 (MST), you wrote:
>1. Make each user add /usr/local/bin (or wherever scp is) to their path in
>their ~/.bashrc

That doesn't suffice.

>3. Add an option to ssh to pass a path to the shell (i've seen this in
>commercial ssh-1.2.27 as --with-path). And then recompile it.

For openssh, this is --with-default-path and works fine. This is the
way to go.

Greetings
Marc

--
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber | " Questions are the | Mailadresse im Header
Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15
Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29
Re: bash: scp: command not found [ In reply to ]
On Fri, 4 Feb 2000, Marc Haber wrote:

> On Wed, 2 Feb 2000 13:15:45 -0700 (MST), you wrote:
> >1. Make each user add /usr/local/bin (or wherever scp is) to their path in
> >their ~/.bashrc
>
> That doesn't suffice.
>
> >3. Add an option to ssh to pass a path to the shell (i've seen this in
> >commercial ssh-1.2.27 as --with-path). And then recompile it.
>
> For openssh, this is --with-default-path and works fine. This is the
> way to go.

I personally feel that if you set --prefix=/usr/local to install,
/usr/local/bin should be automatically added to the default path ...

Marc G. Fournier marc.fournier@acadiau.ca
Senior Systems Administrator Acadia University

"These are my opinions, which are not necessarily shared by my employer"