0

I am an AWS EC2 NOOB, and not a Linux expert. I have finally succeeded in installing an Ubuntu Virtual Machine from VirtualBox onto AWS and have gotten it to launch and ssh connect.

However, I had many failures along with way, and my question has to do with whether the Ubuntu VM needs to be a "server" version &/or whether it needs to be running sshd.

For example, I had Lubuntu-16.04.3 using kernel 4 (non-server) that I got uploaded onto S3 and using the ec2 command "import-image", it went all the way to "completed". I launched the snapshot and it showed the new AMI as running. However, it would never allow me to connect via ssh to the machine, and complained about port 22. (I don't have the exact error anymore.) The Security Group I was using showed port 22 as being open (to the whole world--I know that's not secure, but I was troubleshooting). Further, I opened up ICMP-IPv4 and I successfully pinged to the Lubuntu AMI. So the problem seemed localized to SSH.

I opened up my local VirtualBox copy of the same Lubuntu-16.04.3 and noticed in /etc/ssh/ that there was no sshd_config file and that using nmap -p 22 127.0.0.1, I saw that 22/tcp was closed, and ps aux | grep 'sshd' showed sshd was not running.

On the other hand, the Ubuntu-Server (16.04.6) that I DID get running on AWS EC2 and ssh-connected to, had port 22/tcp OPEN and had sshd running.

So this gets at the heart of my question: either the AMI machine on AWS always needs to be configured to have sshd running, OR the AWS boot image takes care of this (I'm not well-versed in this) and there could have been some other reason that the Lubuntu would not ssh-connect?

(After a few days of research, I decided to ask my first StackExchange question.)

Any insights are most welcome!

Thank you!

mjk
  • 21
  • 2

1 Answers1

0

AWS AMIs always need SSHD Running?

Yes.

Nearly every server that supports sshd should probably have it running. On many platforms: Linux, BSD, UNIX, VMS, others.

This is especially true for cloud instances that have no other good way for remote management. Default OS images in clouds will have sshd running and enabled in the service manager, but for user provided images you need to enable that.

Ubuntu server spins are basically the same as the desktop ones, but without a GUI and with ssh by default. Server roles with no GUI are the default in most environments, smaller and less to secure and patch.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • Thanks for your feedback. For anyone who is trying to import a VirtualBox VM into AWS, I've written detailed instructions [here](https://keslingmj.github.io/Upload_VM_S3_Convert_AMI/Upload_Convert_VM.html) . – mjk Aug 18 '19 at 18:07