1 Answer
- Newest
- Most votes
- Most comments
0
Hello.
As I answered in the previous question, if you change the SSH listening port, you will no longer be able to SSH with EC2 Instance Connect Endpoint.
Please do not change ports other than port 22 or 3389 as they are not allowed.
https://repost.aws/ja/questions/QUNbtjF5hBS8mriY19UuQJ1A/if-i-use-port-2222-instead-of-port-22-ssh-for-the-secure-endpoint-connection-feature-on-the-instance
If you want to change the SSH port number, you will need to connect using Systems Manager's Session Manager, etc.
https://aws.amazon.com/jp/blogs/mt/use-port-forwarding-in-aws-systems-manager-session-manager-to-connect-to-remote-hosts/

I'm currently using an Ubuntu AMI, and I've enabled port 22. Can I change it to port 3389, and will it still work?
Port 3389 is the RDP port number, so it will probably stop working.
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/connect-using-eice.html
Agree only 2 defines ports are supported.
What’s interesting is that the cli supports changing the port. I’m going to investigate
I modified the port number to 3389 instead of 22 in the Ubuntu AMI, and I utilized tunnel commands such as: 'aws ec2-instance-connect open-tunnel --instance-id i-0d76e8852ssf4920e --remote-port 3389 --local-port 5555.' Subsequently, I connected successfully using PuTTY. However, when attempting to connect using Windows Command Line or PowerShell, I encountered connectivity issues with the instance..