๐Ÿš€ Languege/DevOps

[AWS Code Commit] Mac codecommit 403 Error (The requested URL returned error: 403)

mini_world 2021. 7. 29. 12:54
๋ชฉ์ฐจ ์ ‘๊ธฐ

 

MAC ์œ ์ €๋“ค ์ค‘ AWS Code Commit ์ž๊ฒฉ์ฆ๋ช… ์˜ค๋ฅ˜(403) ๊ฐ€๋”... ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

fatal: unable to access '[git์ €์žฅ์†Œ๋ช…]': The requested URL returned error: 403

# git push https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info
fatal: unable to access 'https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info/': The requested URL returned error: 403

์•„๋ž˜ ์ˆœ์„œ์— ๋”ฐ๋ผ ๋ชจ๋“ ๊ฒƒ์ด ์ •์ƒ์ธ์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค.

 

 

1. git ์ž๊ฒฉ์ฆ๋ช… ์„ค์ •ํŒŒ์ผ ํ™•์ธ

์•„๋ž˜ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ด์„œ ์•„๋ž˜์™€ ๊ฐ™์ด ํ•œ์ค„๋งŒ ๋‚˜์˜ค๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
์—ฌ๋Ÿฌ์ค„์ด ์žˆ์„ ๊ฒฝ์šฐ, config ํŒŒ์ผ ๊ฒฝ๋กœ๋กœ ์ฐพ์•„๊ฐ€์„œ ๋‹ค ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.

 

# git config -l --show-origin | grep credential
file:/usr/local/etc/gitconfig	credential.helper=osxkeychain

/usr/local/etc/gitconfig ์— ๋”ฑ ๋‘์ค„๋งŒ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค.

# cat /usr/local/etc/gitconfig
[credential]
helper = osxkeychain

 

2.  ํ‚ค์ฒด์ธ ์ •๋ณด ์‚ญ์ œ

๋จผ์ € ํ‚ค ์ฒด์ธ์— ๋“ค์–ด๊ฐ€๋ด…์‹œ๋‹ค

์ž˜ ๋ณด๋ฉด git ๊ด€๋ จํ•œ ์ž๊ฒฉ์ฆ๋ช…๋“ค์ด ์žˆ์„ํ…๋ฐ์š”,
git-codecommit ์œผ๋กœ ์‹œ์ž‘ํ•˜๋Š” ์ž๊ฒฉ์ฆ๋ช… ์„ ํƒํ•˜๊ณ  ์˜ค๋ฅธ์ชฝ ์šฐํด๋ฆญํ•ด์„œ ์‚ญ์ œ ํ•ด์ค๋‹ˆ๋‹ค.

 

3.  CodeCommit  ํ…Œ์ŠคํŠธ!

์ด์ œ ์ •์ƒ์ ์œผ๋กœ ๋˜๋Š”์ง€ ํ…Œ์ŠคํŠธ ํ•ด๋ด…๋‹ˆ๋‹ค.
๊ทธ ์ „์— "AWS CodeCommit์— ๋Œ€ํ•œ HTTPS Git ์ž๊ฒฉ ์ฆ๋ช…" ์„ค์ •์ด ๋˜์—ˆ๋Š”์ง€ ํ™•์ธํ•ด๋ด…์‹œ๋‹ค.

์ €๋Š” ์ƒˆ๋กœ ์ƒ์„ฑํ–ˆ์Šต๋‹ˆ๋‹ค.

์—ฌ๊ธฐ์„œ ์ƒ์„ฑํ•œ ์ž๊ฒฉ์ฆ๋ช…์„ ์ด์šฉํ•ด์„œ Git Push ํ•ด๋ด…์‹œ๋‹ค!

# git push https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info
Username for 'https://git-codecommit.ap-northeast-2.amazonaws.com': mac-at-871000000000
Password for 'https://mac-at-871000000000@git-codecommit.ap-northeast-2.amazonaws.com':
์˜ค๋ธŒ์ ํŠธ ๋‚˜์—ดํ•˜๋Š” ์ค‘: 5, ์™„๋ฃŒ.
์˜ค๋ธŒ์ ํŠธ ๊ฐœ์ˆ˜ ์„ธ๋Š” ์ค‘: 100% (5/5), ์™„๋ฃŒ.
Delta compression using up to 4 threads
์˜ค๋ธŒ์ ํŠธ ์••์ถ•ํ•˜๋Š” ์ค‘: 100% (3/3), ์™„๋ฃŒ.
์˜ค๋ธŒ์ ํŠธ ์“ฐ๋Š” ์ค‘: 100% (3/3), 330 bytes | 330.00 KiB/s, ์™„๋ฃŒ.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
To https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info
   12d8e59..564d340  master -> master

 

์šฐ์™€ ์™„๋ฃŒ ๋˜์—ˆ์Šต๋‹ˆ๋‹ค ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป๐Ÿ‘๐Ÿป๐Ÿ˜‚๐Ÿ˜‚๐Ÿค—๐Ÿค—

728x90