I am running a putty client on a Windows machine to connect successfully to a Linux box. Now I want to be able to copy a file from the Linux machine under the path /home/ubuntu/myfile
to C:/Users/Anshul/Desktop
on my local computer. The user at the Windows machine is anshul
. I am giving the following command on putty but it is not working:
scp /home/ubuntu/myfile ip_address_of_windows_machine:C:/Users/Anshul/Desktop
I think the path for the Windows machine is wrong. Please help as I have banged my head on a large number of forums but none seem to give correct path for Windows server. Don't suggest alternate options like WinScp
You can also use SCP to transfer files from one server to another, from your client. The syntax will look like this. If you use Windows 10 as client (from version 16.07) you can install the Linux subsystem and get a Ubuntu Bash including APT. With this you can use the syntax already shown.
You can run SCP on Windows via PuTTY. Use the SCP command via the Windows command line interface. You should start each command line with pscp -scp.
Select Environment > SFTP and enable Allow SCP fallback. Select SSH > Authentication, click Browse (...) in Private key file and select the previously generated private key. Click OK. Click Save, enter a name for the connection, and click OK.
This one worked for me.
scp /home/ubuntu/myfile username@IP_of_windows_machine:/C:/Users/Anshul/Desktop
Download pscp
from Putty download page, then use it from Windows Command Line CMD
as follows:
pscp username_linux_machine@ip_of_linux_machine:/home/ubuntu/myfile.ext C:\Users\Name\Downloads
Copying starts once you enter the password for the Linux machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With