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
Access from Windows by Git Bash console:
Try this:
To send a file from windows to linux system
scp path-to-file user@ipaddress:/path-to-destination
Example:
keep in mind that there need to use forward slash(/) inplace of backward slash(\) in for the file in windows path else it will show an error
. After executing scp command you will ask for password of root user in linux machine. There you GO...
To send a file from linux to windows system
scp -r user@ipaddress:/path-to-file path-to-destination
Example:
and provide your linux password. only one you have to add in this command is -r. Thanks.
IMHO, you would use something like the following
The
.
will copy theFile
to the local default directory of your program. For example using GitBash, this saves the File to my configured work folder under D: drive.I had to use pscp like above Hesham's post once I downloaded and installed putty. I did it to Windows from Linux on Windows so I entered the following:
c:\ssl>pscp username@linuxserver:keenan/ssl/* .
This will copy everything in the keenan/ssl folder to the local folder (.) you performed this command from (c:\ssl). The keenan/ssl will specify the home folder of the username user, for example the full path would be /home/username/keenan/ssl. You can specify a different folder using a forward slash (/), such as
c:\ssl>pscp username@linuxserver:/home/username/keenan/ssl/* .
So you can specify any folder at the root of Linux using :/
Keenan
I know this is old but I was struggling with the same. I haven't found a way to change directories, but if you just want to work with the C drive, scp defaults to C. To scp from Ubuntu to Windows, I ended up having to use (notice the double back-slashes):
Hope this helps someone.