Reputation: 1850
I need to copy file admin.zip from C:\wamp\www\jdhemumbai060714\webfiles (Windows) to /var/www/html/ (Linux). I am using following command::
scp C:\wamp\www\jdhemumbai060714\webfiles\admin.zip username@hostname:/var/www/html/
But it does not work and gives error::
ssh: Could not resolve hostname C: Temporary failure in name resolution
I am logged in Linux server using SSH
Upvotes: 11
Views: 30015
Reputation: 366
high likely You were using scp in linux shell logged in via ssh, close connection by exit and in windows cmd with admin rights use the same command, then scp will ask for root password for connection and will confirm if file was found and sent
Upvotes: 3
Reputation: 667
BELOW ANSWER APPLICABLE ONLY FOR EC2 OR WHICH HAS PEM KEY.
Open Windows CMD, and Type
scp -i Keypair_Along_with_Path.pem YOUR_FILENAME_ALONG_WITH_PATH.txt USERNAME@PUBLIC-IP:DESTINATION_PATH
Real Example:
scp -i C:\Users\Keypair.pem C:\Users\File.txt [email protected]:/tmp/.
You are done.
Upvotes: 0
Reputation: 16200
I think that it is bug in SCP port. Only way is skip "C:" and use only "\wamp\www\jdhemumbai060714\webfiles\admin.zip" It will work if current directory is on the same disk like file for upload. Or you can use pscp.exe
Upvotes: 7
Reputation: 59
Well firstly is your DNS server able to resolve the HOSTNAME your copying too? My Advice would be to use IP Address.
scp C:\wamp\www\jdhemumbai060714\webfiles\admin.zip [email protected]:/var/www/html/
Upvotes: 2