기존 EC2 접속 방법
$ssh -i pem경로 ubuntu@ec2의 퍼블릭 Ipv4주소 또는 도메인
쉽게 접속하는 방법
(1) 키페어 .pem파일을 ~/.ssh로 복사
$cp pem키파일 ~/.ssh/
(2) 복사된 pem파일의 권한 변경
$chmod 600 ~/.ssh/pem파일
(3) ~/.ssh에 config파일을 생성 후 아래와 같이 채워넣는다
$vi ~/.ssh/config
#######config 파일 안 ######
Host 원하는 서비스명
HostName 탄력적 ip주소
User ubuntu
IdentifyFile ~/.ssh/pem키 이름
##########################
(4) 생성된 config파일에 권한을 부여해준다
chmod 700 ~/.ssh/config
(5) 이제 변경된 서비스명으로 쉽게 접속이 가능하다!
$ssh config risingEC2
'Server' 카테고리의 다른 글
[Server] WEB(웹서버)과 WAS(웹 애플리케이션 서버)의 차이점 (0) | 2023.02.04 |
---|---|
[Server] 다중서버에서 동일한 구성정보 사용하는 방법! - Domain 모드 | configuration.properties파일 (0) | 2022.11.28 |