Вы находитесь на странице: 1из 1

SSH Туннелирование:

Используйте SSH туннелирование для создания безопасного канала между машиной


администратора и RDS через Bastion Host. Туннель будет перенаправлять запросы на
определенный порт машины администратора на порт PostgreSQL вашего экземпляра RDS.
Пример команды SSH для создания туннеля:

ssh -L localPort:RDS_endpoint:5432 bastion_user@bastion_ip -N

localPort: Порт на локальной машине администратора.


RDS_endpoint: Внутренний DNS имя экземпляра RDS.
bastion_user: Пользователь на Bastion Host.
bastion_ip: Публичный IP-адрес Bastion Host.

_________________________________________________________
SSH Tunneling (Port Forwarding) through EC2 Instance
This method involves creating an SSH tunnel from your local machine to the RDS
instance through an EC2 instance that's in the public subnet.

Prerequisites:

An EC2 instance in the public subnet that can access the RDS instance.
SSH access to the EC2 instance from your local machine.
Steps:

Create an SSH tunnel using a command like:

ssh -i /path/to/your/key.pem -L localPort:rds-instance-endpoint:rdsPort ec2-


user@ec2-public-ip

Replace /path/to/your/key.pem with the path to your PEM key, localPort with a local
port on your machine, rds-instance-endpoint with your RDS endpoint, rdsPort with
your RDS port (default PostgreSQL port is 5432), and ec2-public-ip with the public
IP of your EC2 instance.

Connect to your PostgreSQL database using a local client (like pgAdmin or psql) by
connecting to localhost:localPort.

Вам также может понравиться