how to copy file from local to remote via ssh

angry kiwi asked:

this is how to shh to server

ssh -p 2222 [email protected]

I want to copy file logo.png to public_html folder on server

This is what I tried

scp ./logo.png -p 2222 [email protected]:/public_html/

Don’t know why not work

My answer:

Your command line doesn’t specify the port number correctly.

As seen in the scp man page:

     -P port
             Specifies the port to connect to on the remote host.  Note that
             this option is written with a capital ā€˜Pā€™, because -p is already
             reserved for preserving the times and modes of the file.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.