๋ฐ˜์‘ํ˜•

Git 2.34 ์ดํ›„ ๋ฒ„์ „๋ถ€ํ„ฐ SSH ํ‚ค๋ฅผ ์ด์šฉํ•œ ์ปค๋ฐ‹ / ํƒœ๊ทธ ์„œ๋ช…์„ ์ง€์›ํ•œ๋‹ค. 1Password SSH ํ†ตํ•ฉ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค๋ฉด GPG ํ‚ค ์—†์ด 1Password ์•ฑ์—์„œ Git ์ปค๋ฐ‹ ์„œ๋ช…์„ ์ž๋™์œผ๋กœ ๊ตฌ์„ฑํ•  ์ˆ˜๋„ ์žˆ๋‹ค. ์ปค๋ฐ‹์„ ์„œ๋ช…ํ•˜๋ฉด GitHub ๊ณ„์ •์— ์—ฐ๊ฒฐ๋œ SSH ๊ณต๊ฐœํ‚ค๋กœ ์‹ค์ œ ์‚ฌ์šฉ์ž๊ฐ€ ๋ณ€๊ฒฝํ•œ ๋‚ด์šฉ์ธ์ง€ ๊ฒ€์ฆ ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋Ÿผ ๋‹ค๋ฅธ ์‚ฌ๋žŒ์˜ ์„œ๋ช…ํ•˜์ง€ ์•Š์€ ์ปค๋ฐ‹์„ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ๋‹ค.

GPG(Gnu Privacy Guard)๋Š” GNU ํ”„๋กœ์ ํŠธ์—์„œ ๊ฐœ๋ฐœํ•œ ์˜คํ”ˆ์†Œ์Šค ์•”ํ˜ธํ™” ์†Œํ”„ํŠธ์›จ์–ด๋‹ค. ๊ณต๊ฐœํ‚ค ์•”ํ˜ธํ™” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๋ฉฐ, ์•”ํ˜ธํ™”, ์„œ๋ช…, ์ธ์ฆ ๋“ฑ์˜ ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•œ๋‹ค.

 

์š”๊ตฌ ์‚ฌํ•ญ


  1. 1Password ๋ฒ„์ „ 8์ด์ƒ์˜ ๋ฐ์Šคํฌํ†ฑ ์•ฑ
  2. Git 2.34 ํ˜น์€ ์ดํ›„ ๋ฒ„์ „
  3. 1Password SSH Agent ํ™œ์„ฑ (์ฐธ๊ณ  ํฌ์ŠคํŒ…)
  4. 1Password์— ์ €์žฅ๋œ SSH Key

 

๊ตฌ์„ฑ ๋ฐฉ๋ฒ•


๐Ÿ’ก includeIf ์ง€์‹œ์ž๋ฅผ ์ด์šฉํ•ด์„œ ์—ฌ๋Ÿฌ๊ฐœ์˜ ์ปค๋ฐ‹ ์„œ๋ช…์„ ์„ค์ •ํ•  ์ˆ˜๋„ ์žˆ๋‹ค(์ฐธ๊ณ ๊ธ€)  

 

โถ 1Password์— ์ €์žฅํ•œ SSH Key → ์šฐ์ธก ์ƒ๋‹จ ์„ค์ • ๋ฒ„ํŠผ(์„ธ๋กœ ์  3๊ฐœ) → ์ปค๋ฐ‹ ์„œ๋ช… ๊ตฌ์„ฑ ํด๋ฆญ

 

โท ์ž๋™ ํŽธ์ง‘ ๋ฒ„ํŠผ ํด๋ฆญ

 

ํด๋ฆญํ•˜๋ฉด ~/.gitconfig ๊ตฌ์„ฑ ํŒŒ์ผ์— ์•„๋ž˜ ์Šค๋‹ˆํŽซ์ด ์ž๋™์œผ๋กœ ์ถ”๊ฐ€๋œ๋‹ค.

  • gpg.format : ssh
  • user.signingkey : ์ปค๋ฐ‹ ์„œ๋ช…์„ ์œ„ํ•œ ๊ณต๊ฐœํ‚ค๋กœ ์„ค์ •
  • commit.gpgsign : true (์„ค์ •ํ•˜๋ฉด ์ปค๋ฐ‹์‹œ -S ํ”Œ๋ž˜๊ทธ ์•ˆ๋ถ™์—ฌ๋„ ๋จ)
  • gpg.ssh.program : 1Password๊ฐ€ ์ œ๊ณตํ•˜๋Š” SSH signer ๋ฐ”์ด๋„ˆ๋ฆฌ๋กœ ์„ค์ •

 

โธ GitHub Settings → SSH and GPG keysSigning Key ํƒ€์ž… ์„ ํƒ ํ›„ ๊ณต๊ฐœํ‚ค ๋“ฑ๋ก

1Password ํฌ๋กฌ ๋ถ€๊ฐ€๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๋ฉด ์ €์žฅํ•œ SSH ๋ชฉ๋ก์ด ๋‚˜์˜ค๊ณ , ์„ ํƒํ•˜๋ฉด Title๊ณผ Key๊ฐ€ ์ž๋™์œผ๋กœ ์ฑ„์›Œ์ง„๋‹ค

โน GitHub Settings → SSH and GPG keysFlag unsigned commits as unverified ์ฒดํฌ

๐Ÿ’ก ์ฒดํฌํ•˜๋ฉด ๋ณธ์ธ ๊ณ„์ •์— ๊ท€์†๋œ ๋ชจ๋“  ์ปค๋ฐ‹๊ณผ ํƒœ๊ทธ์˜ ์„œ๋ช… ์ƒํƒœ(Verified / Unverified)๋ฅผ ํ‘œ์‹œํ•œ๋‹ค

 

โบ git commit -m "..." ์ปค๋ฐ‹ ์„œ๋ช… ํ…Œ์ŠคํŠธ (์ปค๋ฐ‹์‹œ 1P ์ž ๊ธˆ ํ•ด์ œ์™€ ๋™์ผํ•œ ๋ฐฉ์‹์œผ๋กœ SSH ํ‚ค ์ธ์ฆ)

์ปค๋ฐ‹์ด ํ™•์ธ๋œ ์„œ๋ช…์ผ ๊ฒฝ์šฐ ์ดˆ๋ก์ƒ‰ Verified ์•„์ด์ฝ˜์ด ํ‘œ์‹œ๋œ๋‹ค

 

๋ ˆํผ๋Ÿฐ์Šค


 

Sign Git commits with SSH | 1Password Developer

Learn how to use the SSH integration to create new Git signing keys and use them with Git clients without the private key ever leaving 1Password.

developer.1password.com

 

๋ฐ˜์‘ํ˜•