docker python3์์ .py ์คํฌ๋ฆฝํธ๋ฅผ ์คํ์์ผฐ์ ๋, ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ฐ์ํ์๋ค.
์ด์ ๋ฅผ ์์๋ณด๋, SSH๋ก ๋ค๋ฅธ ํธ์คํธ๋ฅผ ์ ๊ทผํ๋ ค๋ฉด, ์ฒ์์, ํด๋น ํธ์คํธ์ FingerPrint๋ฅผ ๋ฑ๋กํ ๊ฒ์ธ์ง๋ฅผ ๋ฌผ์ด๋ณด๋๋ฐ, ์ด๋ก ์ธํด์ ์คํฌ๋ฆฝํธ๋ฅผ ์ฒ์ ์คํํ ๋, ์ด ๋ฌผ์ด๋ณด๋ ํ๋กฌํํธ ๋๋ฌธ์, ์คํฌ๋ฆฝํธ๊ฐ ์ค๊ฐ์ ๋ฉ์ถ๊ฑฐ๋ ๋๋ ์
๋ ฅ์ ๋ฐ์ง ๋ชปํด์ ๋์ ํธ์คํธ๋ก ์ ์์ด ์๋ ์ ์๋ค
ํ๋ฒ Finger Print๋ฅผ ๋ฑ๋กํด๋์ผ๋ฉด, ๋ค์๋ถํฐ๋ ๋ฌผ์ด๋ณด์ง ์๊ธฐ ๋๋ฌธ์ ๋ฌธ์ ๋ ์์ง๋ง, ์ด๋ฅผ ํด๊ฒฐํ๊ธฐ ์ํด์๋ ์ฒ์์๋ ๋ฌผ์ด๋ณด์ง ์๋๋ก ๋ฏธ๋ฆฌ ๋ฑ๋ก์ ํด๋์์ผ ํ๋ค.
Finger Print๋ฅผ ๋ฑ๋กํ๋ ํ๋กฌํํธ์์ ๋ฑ๋ก์ ํ๊ฒ ๋๋ฉด, ํด๋น ํธ์คํธ๋ ~/.ssh/known_hosts ๋ผ๋ ํ์ผ์ ๋ฑ๋ก์ด ๋๋ค.
๋ฏธ๋ฆฌ ๋ฑ๋กํ๋ ๋ฐฉ๋ฒ์๋
1. ํด๋น host port์ ๋ชจ๋ ๊ณต๊ฐ ํค๋ฅผ ์ฝ๋๋ค.
ssh-keyscan -p [ํฌํธ๋ฒํธ] [host๋ช
]
2. ํด๋น host port์ ๋ชจ๋ rsa๊ณต๊ฐ ํค๋ฅผ ์ฝ๋๋ค.
ssh-keyscan -t rsa -p [ํฌํธ๋ฒํธ] [host๋ช
]
3. .ssh๋๋ ํ ๋ฆฌ์ known_hosts ํ์ผ์ ํด๋น host์ port๋ฅผ ์ถ๊ฐํ๋ค.
.ssh๋๋ ํ ๋ฆฌ๊ฐ ์๋ค๋ฉด mkdir๋ก ์์ฑํด์ค! (mkdir ~/.ssh)
ssh-keyscan -H -p [ํฌํธ๋ฒํธ] [host๋ช
] >> ~/.ssh/known_hosts
์ฐธ๊ณ ์๋ฃ
https://ciksiti.com/ko/chapters/31-how-to-use-ssh-keyscan-on-ubuntu--linux-hint
Ubuntu์์ ssh-keyscan์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ – Linux ํํธ
Ubuntu์์ ssh-keyscan์ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ – Linux ํํธ ๋ฒ์ฃผ ์ก์ง | July 29, 2021 22:00 Teachs.ru ssh-keyscan์ ์ฌ๋ฌ ํธ์คํธ์ ์ฌ์ฉ ๊ฐ๋ฅํ ๊ณต๊ฐ ํค๋ฅผ ์์งํ๋ ๋ฐ ๋งค์ฐ ์ ์ฉํ ๋๊ตฌ์ ๋๋ค. ์ด ๋๊ตฌ์ ์ฃผ์ ๋ชฉ์
ciksiti.com
SSH known_host ๋ฉ๋ชจ
๋ฐฐํฌ ์๋ํ ์์คํ ์ Packer์ Ansible์ ์ด์ฉํด์ ๋ง๋๋ ค๊ณ ํ๋์ฉ ์ดํ๋ณด๋๋ฐ, Ansible์ด SSH ๊ธฐ๋ฐ์ด๋ค. SSH๋ก ๋ค๋ฅธ ํธ์คํธ๋ฅผ ์ ๊ทผํ๋ ค๋ฉด, ์ฒ์์, ํด๋น ํธ์คํธ์ FingerPrint๋ฅผ ๋ฑ๋กํ ๊ฒ์ธ์ง๋ฅผ ๋ฌผ์ด๋ณด
bcho.tistory.com
https://linuxhint.com/ssh-keyscan-ubuntu/
How to use ssh-keyscan on Ubuntu
I am a trainer of web programming courses. I like to write article or tutorial on various IT topics. I have a YouTube channel where many types of tutorials based on Ubuntu, Windows, Word, Excel, WordPress, Magento, Laravel etc. are published: Tutorials4u H
linuxhint.com
'DevOps | Server' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
API ์ดํดํ๊ธฐ (feat. Open API, REST API) (0) | 2021.10.28 |
---|---|
SSH(Secure Shell) (0) | 2021.09.30 |