LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-01-2011, 07:00 AM   #1
shanky
Member
 
Registered: Aug 2011
Posts: 155

Rep: Reputation: Disabled
Exclamation 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
 
Old 12-01-2011, 07:37 AM   #2
aazkan
Member
 
Registered: Jan 2008
Posts: 72

Rep: Reputation: 5
Quote:
Originally Posted by shanky View Post
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
 
Old 12-01-2011, 08:07 AM   #3
shanky
Member
 
Registered: Aug 2011
Posts: 155

Original Poster
Rep: Reputation: Disabled
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
 
Old 12-01-2011, 08:40 AM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by shanky View Post
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 View Post
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!
 
Old 12-01-2011, 08:41 AM   #5
aazkan
Member
 
Registered: Jan 2008
Posts: 72

Rep: Reputation: 5
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp command zchoyt Linux - General 10 04-02-2014 08:47 AM
[SOLVED] ssh scp key not working to ssh/scp without password rjo98 Linux - Newbie 9 08-22-2011 05:28 PM
SCP command is not working properly due to SSH enabled musammil123 Linux - Server 1 05-27-2011 04:57 PM
Translating windows pscp command to linux scp command help robward Linux - General 2 01-17-2008 07:02 AM
command of scp Paxmaster Linux - General 4 01-06-2005 01:59 PM


All times are GMT -5. The time now is 02:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration