web-dev-qa-db-ja.com

マシンからAmazon EC2にファイルをコピーするにはどうすればよいですか?

ssh -i node.pem [email protected]を使用してAmazon EC2インスタンスにsshできます

gametestというフォルダーをラップトップからgametestというフォルダーのインスタンスにコピーしようとしています。私は許可を拒否され続けています。コマンドscp -v -r -i node.pem /Users/path/to/file/gametest [email protected]:/gametestを試しました。何が悪いのでしょうか?

詳細な出力を次に示します(プライバシー保護のため、ユーザー名をUSERに変更しました)。

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: [email protected]
debug1: kex: Host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] 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 [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] 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
4
swagrov

コメントに記載されているように、

scp -v -r -i node.pem /Users/path/to/file/gametest [email protected]:

したがって、gametestディレクトリがサーバーに作成されます。

gametestというフォルダが緑色で強調表示されます。どういう意味ですか?

緑色は環境設定に依存します。これは、ディレクトリであることを意味するか、書き込み可能または読み取り可能などの権限を指定できます。

1
marcanuy