I am able to ssh into my Amazon EC2 instance with ssh -i node.pem ubuntu@35.164.71.227
I am trying to copy over a folder called gametest from my laptop to the instance in a folder called gametest. I keep getting permission denied. I tried the command scp -v -r -i node.pem /Users/path/to/file/gametest ubuntu@35.164.71.227:/gametest. What is going wrong?
Here is the verbose output (I changed my username to USER for privacy).
Executing: program /usr/bin/ssh host 35.164.71.227, user ubuntu, command scp -v -r -t /gametest
OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to 35.164.71.227 [35.164.71.227] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file node.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file node.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 35.164.71.227:22 as 'ubuntu'
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:N7OMBCEHZm9trGWevCHV02WAffY49Bt6ET9qQOqdvqM
debug1: Host '35.164.71.227' is known and matches the ECDSA host key.
debug1: Found key in /Users/USER/.ssh/known_hosts:11
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: node.pem
debug1: Authentication succeeded (publickey).
Authenticated to 35.164.71.227 ([35.164.71.227]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v -r -t /gametest
Entering directory: D0755 0 gametest
Sink: D0755 0 gametest
scp: /gametest: Permission denied
USER-mac01:downloads USER$ debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2516, received 2592 bytes, in 0.2 seconds
Bytes per second: sent 10657.0, received 10979.0
debug1: Exit status 1