Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an AMI that takes SSH on port 443? [closed]

My question is, put simply

Is there any AMI that comes with SSH configured on port 443?

The main reason why I ask is that, despite working in IT, my company filters all ports but 443 and 80, and requires all my connections to go through an HTTP proxy.

I have connected via SSH before on hosts that accept ssh on port 443, using corkscrew. A friend of mine is still able to do that, but it involves leaving the office or using a VPN to connect to the amazon instance, changing the line in the SSHD config, and restarting SSH.

Is there an AMI that has that done by default?

like image 518
Pedro Avatar asked Dec 08 '22 21:12

Pedro


1 Answers

You can accomplish your goal of running sshd on an alternative port like 80 or 443 with a standard EC2 instance, as long as the AMI supports user-data scripts that run when the instance first boots. Both Amazon Linux and Ubuntu AMIs support this with CloudInit.

For example, you can start an Ubuntu EC2 instance with the following user-data:

#!/bin/bash -ex
perl -pi -e 's/^#?Port 22$/Port 443/' /etc/ssh/sshd_config
service sshd restart || service ssh restart

and after it boots, you can ssh in to port 443.

Here's an article I wrote a couple years ago describing this method: http://alestic.com/2010/12/ec2-ssh-port-80

like image 77
Eric Hammond Avatar answered May 16 '23 09:05

Eric Hammond