WEB/Server

[AWS EC2] Putty๋กœ EC2์„œ๋ฒ„ ์ ‘์†ํ•˜๊ธฐ(SSH)

kite707 2021. 10. 13.

๐Ÿ“ŒAWS ๊ณ„์ •์„ ๋งŒ๋“ค๊ณ  ์ธ์Šคํ„ด์Šค ์ƒ์„ฑ๊นŒ์ง€ ์™„๋ฃŒํ–ˆ๋‹ค๋Š” ๊ฐ€์ • ํ•˜์— ์ง„ํ–‰ํ•ฉ๋‹ˆ๋‹ค

๐Ÿ“Œputty, puttygen์ด ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜ ๋งํฌ์—์„œ ๋‹ค์šด๋กœ๋“œ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.

https://www.putty.org/

 

Download PuTTY - a free SSH and telnet client for Windows

Is Bitvise affiliated with PuTTY? Bitvise is not affiliated with PuTTY. We develop our SSH Server for Windows, which is compatible with PuTTY. Many PuTTY users are therefore our users as well. From time to time, they need to find the PuTTY download link. W

www.putty.org

์šฐ์„  ์œ„์™€ ๊ฐ™์€ ์ฐฝ์— ์ ‘์†ํ•œ๋‹ค. ์ด์ œ ์ธ์Šคํ„ด์Šค id๋ฅผ ๋ˆ„๋ฅด๋ฉด ์ธ์Šคํ„ด์Šค์˜ ์ •๋ณด๋“ค์„ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ssh๋ฐฉ์‹์œผ๋กœ ํ•ด๋‹น ์ธ์Šคํ„ด์Šค์— ์ ‘๊ทผํ•˜๋ ค๋ฉด ์ธ์Šคํ„ด์Šค๋ฅผ ์ƒ์„ฑํ•  ๋•Œ ๋งŒ๋“ค์—ˆ๋˜ ํ‚ค ํŽ˜์–ดํŒŒ์ผ์ด ํ•„์š”ํ•˜๋‹ค. ์•„๋งˆ ๋งŒ๋“ค์–ด์ ธ ์žˆ๋Š” keyfile์€ .pemํ˜•์‹์ธ๋ฐ puttygen์„ ์ด์šฉํ•˜์—ฌ keyfile์„ .ppkํ˜•์‹์œผ๋กœ ๋ณ€ํ™˜ํ•ด ์ฃผ์–ด์•ผ ํ•œ๋‹ค.

keyfile ํ˜•์‹ ๋ณ€ํ™˜

์šฐ์„   puttygen์„ ์‹คํ–‰ํ•˜๊ณ  Load ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅธ๋‹ค.

์ฒ˜์Œ ์ธ์Šคํ„ด์Šค๋ฅผ ๋งŒ๋“ค ๋•Œ ์ €์žฅํ•œ keyfile์„ ํด๋ฆญํ•œ๋‹ค. 

๊ฐ„ํ˜น pemํŒŒ์ผ์ด ๋ณด์ด์ง€ ์•Š๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ ํŒŒ์ผ ํ˜•์‹์„ All Files๋กœ ๋ณ€๊ฒฝํ•˜๋ฉด ๋ณด์ธ๋‹ค.

์œ„์™€ ๊ฐ™์€ ์ฐฝ์ด ๋œจ๊ณ  Save private key๋ฅผ ํด๋ฆญํ•˜๋ฉด ๋œ๋‹ค.

ํŒŒ์ผ ์ด๋ฆ„์€ ๋ณ€๊ฒฝํ•˜์ง€ ๋ง๊ณ  ๊ทธ๋ƒฅ ์ €์žฅํ•˜๋ฉด ppkํ˜•์‹์˜ ํŒŒ์ผ์ด ํ•˜๋‚˜ ๋” ์ƒ๊ธด๋‹ค. ์ด์ œ ์ด๊ฒƒ์„ ์ด์šฉํ•˜์—ฌ putty์—์„œ ์ธ์Šคํ„ด์Šค์— ์ ‘์†ํ•  ๊ฒƒ์ด๋‹ค.

Putty์—์„œ EC2 ์ธ์Šคํ„ด์Šค ์ ‘์†

์šฐ์„  ํผ๋ธ”๋ฆญ IPv4 ์ฃผ์†Œ๋‚˜ ํผ๋ธ”๋ฆญ IPv4 DNS๊ฐ€ ํ•„์š”ํ•˜๋‹ค. ๋‘˜ ๋‹ค aws ์ฝ˜์†”์ฐฝ์—์„œ ์ธ์Šคํ„ด์Šค id๋ฅผ ๋ˆŒ๋Ÿฌ ํ™•์ธํ•  ์ˆ˜ ์žˆ๋‹ค.

ํŒŒ๋ž€ ๋ฐ•์Šค ๋ถ€๋ถ„์— ์žˆ๋Š” ๊ฒƒ ๋‘˜ ์ค‘ ์•„๋ฌด๊ฑฐ๋‚˜ ํ•˜๋‚˜๋งŒ ์žˆ์œผ๋ฉด ๋œ๋‹ค.

์ด์ œ putty์— Host Name๋ž€์— ํ•ด๋‹น ๊ฐ’์„ ์ž…๋ ฅํ•  ๊ฑด๋ฐ ์•ž์— ubuntu@๋ฅผ ๋ถ™์—ฌ์•ผ ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์ง€ ์•Š๋Š”๋‹ค. ๋งŒ์•ฝ ํผ๋ธ”๋ฆญ IPv4์ฃผ์†Œ๊ฐ€ 1.23.567.89๋ผ๋ฉด ubuntu@1.23.567.89์™€ ๊ฐ™์ด ์ž…๋ ฅ์„ ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค.

ํ›„์— ํŽธํ•˜๊ฒŒ ์ ‘์†ํ•˜๊ธฐ ์œ„ํ•ด ์ €์žฅ์„ ํ•ด ๋†“๋Š” ๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค. ์ด๋ฆ„์„ ์„ค์ •ํ•˜๊ณ  save ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ๋œ๋‹ค.

์ด์ œ ์•„๊นŒ ๋งŒ๋“ค์–ด ๋†“์€ .ppkํ˜•์‹์˜ keyfile์„ ๋“ฑ๋กํ•  ๊ฒƒ์ด๋‹ค. ์™ผ์ชฝ์—์„œ Connection/SSH/Auth๋ฅผ ํด๋ฆญํ•˜๋ฉด ์•„๋ž˜์™€ ๊ฐ™์€ ์ฐฝ์ด ๋‚˜์˜จ๋‹ค. ์—ฌ๊ธฐ์„œ Browse๋ฒ„ํŠผ์„ ๋ˆŒ๋Ÿฌ .ppkํŒŒ์ผ์„ ๋“ฑ๋กํ•˜๋„๋ก ํ•˜์ž.

keyํŒŒ์ผ์ด ๋“ฑ๋ก๋œ ๋ชจ์Šต

์ด์ œ open๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋ฉด ์ ‘์†์ด ์™„๋ฃŒ๋œ๋‹ค. 

์ด๋ ‡๊ฒŒ ๋œจ๋ฉด ์ ‘์† ์„ฑ๊ณต์ด๋‹ค.

๋Œ“๊ธ€