2016-10-11 18 views
0

ローカルファイルを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 

答えて

3
scp: /var/app/current/config/pk-cfappkey.pem: Permission denied 

ディレクトリ/var/app/current/config/に移動します。

ssh [email protected][id].compute-1.amazonaws.com 

し、適切な sudoアクセスして適切な場所に移動:サーバーに接続し、その後

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: 

sudo cp pk-cfappkey.pem /var/app/current/config/ 
あなたは他の場所でファイルをコピーする必要があります
関連する問題