So, I'm attempting to simply transfer folder of files from my local computer to a server via ssh and scp. After sudoing I'm using the command as follows:
scp -r C:/desktop/myfolder/deployments/ user@host:/path/to/whereyouwant/thefile
I get the error:
ssh: C: Name or service not known
I'm guessing its my syntax for c:/desktop
etc. Any ideas?
BTW I'm using putty + Windows 7.
Drive letters can be used in the target like
where
c
is the drive letter. It's treated like a directory.Maybe this works on the source, too.
On windows you can use a graphic interface of scp using winSCP. A nice free software that implements SFTP protocol.
If your drive letter is C, you should be able to use
scp -r \desktop\myfolder\deployments\ user@host:/path/to/whereyouwant/thefile
without drive letter and backslashes instead of forward slashes.
You are using putty, so you can use pscp. It is better adapted to Windows.
I have found it easiest to use a graphical interface on windows (I recommend mobaXTerm it has ssh, scp, ftp, remote desktop, and many more) but if you are set on command line I would recommend cd'ing into the directory with the source folder then
scp -r yourFolder username@server:/path/to/dir
the
-r
indicates recursive to be used on directoriesDrive letter can be used in the source like
You can also try this: