ローカルファイルをec2インスタンス内のディレクトリに転送するために提供されたドキュメントに従っていますが、私はec26インスタンスのパスとファイルの先頭にあるPermission denied
エラー。AWS Ec2 - Scpファイル転送の許可が拒否されました
同じコマンドを使用しても問題がないため、これは資格情報の問題ではありません。I ssh
私が興味を持っているのはおそらく、ec2インスタンス内またはローカルでのファイルとフォルダのアクセス許可と、それが転送を妨げている場合のアクセス許可です。
追記:この問題であればわからない、しかし、ときに私と同じ資格情報を持つssh
、私は/home/ec2-user
にもたらしていると私はls -a
を実行したとき、私は/var/app
が表示されていないが、何の問題もなく、それにcd
と私のアプリを見つけることができます。
完全なエラーメッセージ:ここに
scp: /var/app/current/config/pk-cfappkey.pem: Permission denied
は私のscpコマンドである:ここで
scp -vvv -i /Users/user/.ssh/app-key-pair /Users/user/Desktop/Projects/node/project/config/pk-cfappkey.pem [email protected][id].compute-1.amazonaws.com:/var/app/current/config
は私のフォルダとファイルのアクセス権
Ec2とインスタンスのフォルダパスです:
/var/app/current/config
drwxr-xr-x 2 nodejs nodejs 4096 Oct 9 14:35 config
ローカルファイル(PK-cfappkey.pem):(まとめ)
[email protected] 1 user staff 1706 Sep 24 15:09 pk-cfappkey.pem
詳細なエラーメッセージ:あなたのユーザーec2-user
が書き込みアクセス権を持っていない
debug1: Connecting to ec2-[id].compute-1.amazonaws.com [id] port 22.
debug1: Connection established.
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug2: callback start
debug1: Sending command: scp -v -t /var/app/current/config
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
Sending file modes: C0644 1706 pk-cfappkey.pem
debug2: channel 0: rcvd ext data 45
Sink: C0644 1706 pk-cfappkey.pem
debug2: channel 0: written 45 to efd 8
scp: /var/app/current/config/pk-cfappkey.pem: Permission denied
debug2: channel 0: read<=0 rfd 6 len 0
debug2: channel 0: read failed
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed