[AWS Transfer Family] SFTP ์ ‘์† ์‹œ ํผ๋ฏธ์…˜ ์—๋Ÿฌ ํ•ด๊ฒฐ(bad permissions/Permission denied(publickey))

2022. 6. 19. 00:12ใ†AWS/troubleshooting

โ˜„๏ธ ๋ฌธ์ œ

private key๋ฅผ ์ด์šฉํ•˜์—ฌ Transfer Family ์—”๋“œํฌ์ธํŠธ๋กœ ์ ‘์† ์‹œ ์—๋Ÿฌ ๋ฐœ์ƒ ๋ฐ ์ ‘์† ๋ถˆ๊ฐ€.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions for '{ private-key }' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "{ private-key }": bad permissions
Permission denied (publickey).

 

 

๐ŸŒŽ ํ™˜๊ฒฝ

  • AWS Transfer Family
    • Protocol : SFTP(SSH File Transfer Protocol)
    • Access : Internal
    • Domain : EFS
    • users
      • Role์— ์—ฐ๊ฒฐ๋œ Policy
        • AmazonElasticFileSystemFullAccess (Amazon Managed Policy)
        • AmazonElasticFileSystemClientFullAccess (Amazon Managed Policy)
      • ํ•ด๋‹น user์— SSH Public Key ๋“ฑ๋ก ์™„๋ฃŒ

 


 

๐Ÿ”ซ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

private key ํŒŒ์ผ์˜ ๊ถŒํ•œ์„ ์†Œ์œ ์ž๋งŒ ์ฝ๊ธฐ&์‹คํ–‰์ด ๊ฐ€๋Šฅํ•˜๋„๋ก ๋ณ€๊ฒฝํ•œ๋‹ค.

Linux

chmod 600 { private-key.pem }

Windows

1. { private key } ์šฐํด๋ฆญ > ์†์„ฑ > [๋ณด์•ˆ] ํƒญ > [๊ณ ๊ธ‰] ๋ฒ„ํŠผ ํด๋ฆญ

 

2. [์ƒ์† ์‚ฌ์šฉ ์•ˆํ•จ] ๋ฒ„ํŠผ ํด๋ฆญ

๊ณ ๊ธ‰ ๋ณด์•ˆ ์„ค์ • > [์ƒ์† ์‚ฌ์šฉ ์•ˆ ํ•จ] ๋ฒ„ํŠผ ํด๋ฆญ

3. [์ด ๊ฐœ์ฒด์—์„œ ์ƒ์†๋œ ์‚ฌ์šฉ ๊ถŒํ•œ์„ ๋ชจ๋“œ ์ œ๊ฑฐํ•ฉ๋‹ˆ๋‹ค.] ์„ ํƒ

[์ƒ์†๋œ ์‚ฌ์šฉ ๊ถŒํ•œ ๋ชจ๋‘ ์ œ๊ฑฐ] ์„ ํƒ

4. [์ถ”๊ฐ€] ๋ฒ„ํŠผ ํด๋ฆญ

๊ณ ๊ธ‰ ๋ณด์•ˆ ์„ค์ • > [์ถ”๊ฐ€] ๋ฒ„ํŠผ ํด๋ฆญ

5. [๋ณด์•ˆ ์ฃผ์ฒด ์„ ํƒ] ๋ฒ„ํŠผ ํด๋ฆญ

๊ถŒํ•œ ํ•ญ๋ชฉ > [๋ณด์•ˆ ์ฃผ์ฒด ์„ ํƒ] ๋ฒ„ํŠผ ํด๋ฆญ

6. ์ž์‹ ์˜ ์œˆ๋„์šฐ ๊ณ„์ • ์ด๋ฆ„ ์ž…๋ ฅ ๋ฐ ์ด๋ฆ„ ํ™•์ธ

7. ๊ถŒํ•œ ํ™•์ธ ๋ฐ [ํ™•์ธ] ๋ฒ„ํŠผ ํด๋ฆญ

 

⇒ ํ‚ค ํŒŒ์ผ ๊ถŒํ•œ ๋ณ€๊ฒฝ ํ›„, ์ •์ƒ์ ์œผ๋กœ ์ ‘๊ทผ ์„ฑ๊ณต~~~!

(SFTP ์ ‘์† ์‹œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ๋ผ AWS์—๋งŒ ๊ตญํ•œ๋˜๋Š” ์ฃผ์ œ๊ฐ€ ์•„๋‹ˆ๊ธด ํ•˜์ง€๋งŒ..! AWS Transfer Family ํ™˜๊ฒฝ์—์„œ SFTP๋ฅผ ์ด์šฉํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— AWS ์ฃผ์ œ์— ๋„ฃ์Šต๋‹ˆ๋‹ค ๐Ÿซฃ)

 


๐Ÿ”— ์ฐธ๊ณ  ๋งํฌ

  1. ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ: ์œˆ๋„์šฐ10 SSH ์ ‘์†์‹œ PEM ํŒŒ์ผ ํผ๋ฏธ์…˜ ์—๋Ÿฌ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•
  2. ๊ธฐ์ˆ  ๋ธ”๋กœ๊ทธ: AWS:pemํ‚ค์— ๋Œ€ํ•ด bad permissions ์˜ค๋ฅ˜ ๋ฐœ์ƒํ•  ๋•Œ