LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Embedded & Single-board computer (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/)
-   -   'sh: scp: not found' error (https://www.linuxquestions.org/questions/linux-embedded-and-single-board-computer-78/sh-scp-not-found-error-4175590514/)

xiongnu 09-30-2016 03:57 PM

'sh: scp: not found' error
 
hi, i'm trying to transfer file from my embedded linux system to window7 machine through 'scp'.

I installed 'putty.exe' and 'pscp.exe' on windows machine and have 'sshd' server running on embedded system with busybox installed.

when i run:
pscp -P myport# root@www.myserver.com:\mnt\usb\Usb_Disk_1\music\t2.mp3 .
root@www.myserver.com's password:
sh: scp: not found

my scp is located in '/program/openssh/bin' and i've added to the path:

/etc # export PATH=$PATH:/program/openssh/bin
/etc # echo "$PATH"
/usr/bin:/bin:/usr/sbin:/sbin:/home/work/sshd/bin:/home/bin:/home/program:/home/bin/openssh/bin:/program/openssh/bin

how to fix this?

keefaz 09-30-2016 04:18 PM

It says "not found", not "command not found"
I think scp doesn't find the file, did you check the file path?
Maybe test with another file

michaelk 09-30-2016 05:32 PM

Are you running that command on linux or windows. If your embedded device is sftp capable you can use filezilla or winzip GUI applications.

If running that command from windows then use the full path to pscp or add it to the path environment.

pscp.exe is a scp client and not a server.

blue_z 10-01-2016 03:57 AM

Quote:

sh: scp: not found
This error message means that the shell cannot execute the specified command (e.g. scp).
The file "not found" is typically the dynamic linker/loader or a shared library required by the executable.
This error message typically occurs when a (foreign) executable is installed in a rootfs that uses a different version of shared libraries (e.g. the executable was compiled for glibc, but the (embedded) rootfs has uClibc).

If you have strace already installed, then the command `strace scp` should reveal the missing file.
Otherwise use `strings scp | less` to view the names of the shared libraries used by scp. Compare the extracted library names to what's in /lib.

Regards

xiongnu 10-03-2016 09:59 AM

it turned out that 'scp' wasn't in the executable path(/usr/bin:/bin:/usr/sbin:/sbin). it's located in '/program/openssh/bin' folder and i couldn't add it to path by issuing 'export PATH=$PATH:/program/openssh/bin' because '/etc/profile' is read only on the embedded system.

after i copied 'scp' to /bin folder, transferring file went smoothly.


All times are GMT -5. The time now is 05:24 AM.