DB-connected SSH tunnel from Windows to Amazon RDS

Asked 1 years ago, Updated 1 years ago, 384 views

I want to connect to MySQL on Amazon RDS from the Heidi SQL client tool in Windows, but it doesn't work.The following error appears:

Connection failed SSH expired unexpected command line wasplink.exe-ssh username @Endpon and -P22-i "Key Location" -N-L...

Is the SSH connection tool called plink not working well?

Please let me know if you have any client software that can quickly connect to Amazon RDS via SSH tunnel in Windows.

Reference Site
https://into-the-program.com/aws-rds-heidisql/

Run the following on PowerShell

"C:\Program Files\HeidiSQL\plink.exe"[email protected]
Location line: 1 character: 39
+ "C:\Program Files\HeidiSQL\plink.exe" [email protected]
+                                       ~~~~~~~~~~~~~~~~~~~~~~
The expression or statement token '[email protected]' cannot be used.
    + CategoryInfo:ParserError:(:)[], ParentContainsErrorRecordException
    + Fully QualifiedErrorId—UnexpectedToken

Running on CMD

"C:\Program Files\HeidiSQL\plink.exe"-ssh-i"C:\Downloads\imports\kagi.ppk"[email protected]
Enable to use key file "C:\Downloads\importants\kagi.ppk" (enable to open file)
Using username "ec2-user".
FATAL ERROR: No supported authentication methods available (server sent: publickey, gssapi-keyex, gssapi-with-mic)

If you choose ssh.exe? and .pem from HeidiSQL

Enter a description of the image here

From powershell
You can log in to the instance using the following command:

[email protected] C:\Downloads\importants\kagi.pem

windows ssh amazon-rds

2022-12-31 23:39

1 Answers

The RDS instance itself cannot be ssh-connected.

In addition to the RDS instance, there is an EC2 instance of Linux that is expected to be used as a stepping stone at the reference site.Because the plink tool itself connects to the EC2 instance, the IP address specified for plink should be the public IP address assigned to the EC2 instance.Have you tried that kind of configuration?

Other possible methods include:

  • Assign a public IP address to the RDS and connect without SSH (it's not a very recommended method for security, but it's easy)
  • Launch an EC2 instance of Windows and connect to RDP from there.

The document says almost the same thing:
https://docs.aws.amazon.com/ja_jp/AmazonRDS/latest/UserGuide/CHAP_CommonTasks.Connect.html#CHAP_CommonTasks.Connect.ScenariosForAccess


2023-01-01 01:15

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.