AWS Bastion Port Forwarding Shell Script

Example


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
function aws_forwarding_by_bastion {
    echo "Remove localhost..."
    ssh-keygen -R localhost
 
    echo "connecting to bastion: ${AWS_BASTION_ENDPOINT}"
    echo "forwarding local SSH port(22) to Test EC2 - ${AWS_TEST_EC2_ENDPOINT}:22."
    echo "forwarding local Kibana port(9200) to AES:443"
    echo "forwarding local DB port(3306) to Test DB:3306"
    echo ""
 
    sudo ssh -i ~/.ssh/{pem file} ec2-user@${AWS_BASTION_ENDPOINT} \
        -L 22:${AWS_TEST_EC2_ENDPOINT}:22 \
        -L 9200:${AWS_ES_ENDPOINT}:443 \
        -L 3306:${AWS_TEST_RDS_ENDPOIN}:3306
}

댓글

이 블로그의 인기 게시물

[Protocol] WIEGAND 통신

Orange for Oracle에서 한글 깨짐 해결책

[UI] GNB·LNB·SNB·FNB 용어 설명