I need to copy a directory with all its subdirectories to an SFTP server.
I can access the SFTP server by
Code:
sftp -oPort=#### USERNAME@IPADDRESS
But when I want to recursively copy all files, SFTP replies
Code:
put -r /local-dir/ /remote-dir/
put: Invalid flag -r
When looking on the internet, people advises to use SCP (I'm also more familiar with SCP). But this gives an error:
Code:
scp -P #### /local-dir/ USERNAME@IPADDRESS:/remote-dir/
Connection to IPADDRESS closed by remote host.
lost connection
Is this a server issue? I have no control over the server.
If it is, I'm obliged to use SFTP. But then I have the invalid flag -r issue. How can I solve this?
I'm using
Code:
$ ssh -v
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
Thanks for your help
-- Ivan