I am trying to do both upload / download file into my server using ubuntu command lines but somehow it keeps on giving me permission denies. I have tried using -F and -i both doesn't work.
I tried something like
sudo scp -v /path/to/my/file/ ubuntu@ip-xx-xxx-xxx-xx:~/path/to/where/upload
sudo scp -v -i ~/.s/path/to/my/file/ ubuntu@ip-xx-xxx-xxx-xx:~/path/to/where/upload
sudo scp -v -F ~/.ssh/xxx.pem /path/to/my/file/ ubuntu@ip-xx-xxx-xxx-xx:~/path/to/where/upload
the above is just trying to upload. Same for download too but of course reversed the order but didn't work too. For download, I used terminal to log into the server already and used something like this but in reverse sudo scp -v /path/to/my/file/ ubuntu@ip-xx-xxx-xxx-xx:~/path/to/where/upload
EDIT:
Getting errors like such and also, I tried using touch and able to make files without a problem too
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:QgAQzu59hpmTEGkNnOdEeflCYVImcwLLU3qQD7foqbE
debug1: Host 'ip-xxx-xx-xx-xx' is known and matches the ECDSA host key.
debug1: Found key in /home/ubuntu/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/ubuntu/.ssh/id_rsa
debug1: Trying private key: /home/ubuntu/.ssh/id_dsa
debug1: Trying private key: /home/ubuntu/.ssh/id_ecdsa
debug1: Trying private key: /home/ubuntu/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).