scp local to remote with key code example
Example 1: scp with ssh key
scp -i ~/.ssh/id_rsa.pub FILENAME USER@SERVER:/home/USER/FILENAME
Example 2: scp to remote server
scp ./file.txt remote_username@remote_ip:/remote/directory
Example 3: scp local to remote
scp -i <private_key> ./file.txt remote_username@remote_ip:/remote/directory