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!