11

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

4 Answers 4

7

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

Sign up to request clarification or add additional context in comments.

1 Comment

That was actually my problem. SCP seems to take everything before the ":" as a hostname instead of the windows drive letter. I did just started CMD from the target folder and instead of defining the local folder I just typed "." for the current folder.
3

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

Comments

2

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/

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.