LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   scp command not working ?? (https://www.linuxquestions.org/questions/linux-newbie-8/scp-command-not-working-916527/)

shanky 12-01-2011 06:00 AM

scp command not working ??
 
Hi,
i am trying to use scp command to send some files from my pc to another pc but it just does not work.
Suppose i have a text file report.txt
i use:
scp report.txt 192.168.40.89 ,this shows me
cp: cannot stat `report.txt': No such file or directory

when i use:
scp report 192.168.40.89,the console just takes me to the next waiting for my next command.
When i go back and on my other pc there is no such file in the home directory.
Why is this happening?
Please point the mistake i am committing.
thanks

aazkan 12-01-2011 06:37 AM

Quote:

Originally Posted by shanky (Post 4539007)
scp report.txt 192.168.40.89 ,this shows me
cp: cannot stat `report.txt': No such file or directory

Hi,
Try this if it works

Code:

scp /path/to/report.txt 192.168.40.89:/some/path/on/this/host

shanky 12-01-2011 07:07 AM

Hi tried as you told me
it gives me this error

ssh: connect to host 192.168.40.89 port 22: No route to host
lost connection

colucix 12-01-2011 07:40 AM

Quote:

Originally Posted by shanky (Post 4539007)
scp report.txt 192.168.40.89 ,this shows me
cp: cannot stat `report.txt': No such file or directory

This simply states that there is no file named report.txt in the current working directory.
Quote:

Originally Posted by shanky (Post 4539007)
scp report 192.168.40.89,the console just takes me to the next waiting for my next command.
When i go back and on my other pc there is no such file in the home directory.
Why is this happening?

The scp command does a remote copy if the destination has a colon after the IP address. If not, the IP address will be treated as a file name and scp will do a local copy of report to a file called 192.168.40.89. You should have it in the working directory, right now!

aazkan 12-01-2011 07:41 AM

Is the host 192.168.40.89 pingable from wher you want scp? If it is, is there an sshd running there? Or if iptables is blocking tcp port 22? Are using root to scp across?
To check if tcp 22 (default ssh) is running and reachable, from where you want to scp, do

Code:

nmap -n -T4 -p 22 192.168.40.89
or poor man port check

Code:

telnet 192.168.40.89 22
Was wondering if you have tried


Code:


scp /somepath/report.txt root@192.168.40.89:/somepath/thishost/

change root with any other local username on 192.168.40.89 if you wish


All times are GMT -5. The time now is 01:17 AM.