By setting the SCP, you need to specify the source path (OK) and the destination path (NOT OK). See man page scp
scp ... [user@]host1:]file1 ... [user@]host2:]file2
The other parameters you specified are correct:
- -r for recursive. This you use to send multiple files within the specified path ("at once"), as long as they are all inside the directory ./public_html (in your example). To send files individually, you need a shell script that lists the files and sends them one by one (something merging the find with the xargs).
- -p door-to-door.
The destination path was missing. How would the command look: (note the :/var/www/):
scp -p 9922 -r ./public_html [email protected]:/var/www/
Another detail very important is the permission. The user usuario-ssh must have written permission in the directory /var/www/.
Note: The port cannot be at the end of the command, but is confused with the destination directory.
I set the path according to the server
:/home/meusite.com/public/
even so it did not give. It continues the same error "No such file or directory", I removed the port and it failed to connect.– KaduAmaral
I was able to solve the error by passing the port parameter to the beginning of the command:
scp -p 9922 [user@]host1:]file1 ... [user@]host2:]file2
– KaduAmaral