도커 내부에서 ssh로 ec2 연결하기

백종현·2023년 5월 27일
0

ubuntu 이미지 설치 후, 컨테이너 실행.

docker cp <host 키페어위치> <컨테이너 이름>:<컨테이너 내부 옮길 위치>

apt update
apt install openssh-server
apt install openssh-client (scp 사용을 위해서)

이후, chmod 400 <키페어>
ssh -i "키페어" <이름>@<주소>
ex) ssh -i "Xxx.pem" ubuntu@ec2-Xxxxx.ap-northeast.compute.amazonaws.com

profile
노력하는 사람

0개의 댓글