scp copies files between hosts on a network. It uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Unlike rcp, scp will ask for passwords or passphrases if they are needed for authentication.
It can be useful for automated transferring of files using coding.The prompt for password can be bypassed by generating authenticated public and private keys using command “ssh-keygen” and after that “scp” can be simply called using the “system” function in c++ etc. and automated file transfer can take place.
example syntax :–
scp user@host1:source_file_path user@host2:destination_file_path
example :–
scp /root/send.txt root@172.16.11.22:/root/received.txt
using this the file send.txt in the local machine will be copied and renamed as received.txt to /root directory of machine 172.16.11.22 and the connection to machine 172.16.11.22 will be made as user root on that machine ( ofcourse password will be asked unless a public private key relation is mentained between both machines).

