AWS EC2 virtualmin access to new virtual server

I’ve been searching everywhere for this but just not finding the answer. I see many people use Virtualmin with EC2 but they don’t ever say how do you gain access to the new Virtual Server you created.

Virtualmin / Webmin seem to be running fine.

I create Virtual Server
Domain name: example.com
Description: testing
Administration password: superman
rest of features are default

Creates fine.

Now I have tried to SSH and FTP to
ec2-{something}.compute-1.amazonaws.com (of course replace {something} with your info)
also tried the elastic IP assigned

Now I can SSH and FTP using ec2-user and I have access to /home/ec2-user and I can see the directories under /home for the newly created Virtual Server example.com but I don’t have access
$ cd /home/example
-bash: cd: /home/example: Permission denied
$ ls -l /home
total 8
drwx------ 3 ec2-user ec2-user 4096 Jun 13 07:17 ec2-user
drwxr-x— 11 example example 4096 Jun 13 15:14 example

I went to EC2 and create another SSH key and copied it to my laptop and tried using that, no luck, tried using the same key I use when I connect successfully with ec2-user and no luck using user: example

In looking at
$ sudo vi /etc/ssh/sshd_config

EC2 uses keys for remote access

PasswordAuthentication no

Anyone know what I’m missing here? I’d really appreciate any help so I can actually get a site uploaded, SQL database imported and hopefully just change DNS to point to the elastic IP and up and running (hopefully)

Are you behind a router? Is this a local install or a remote install?

@wildweaselmi

regards the ssh when you do changes on config you should always restart ssh server. normally for example password login is disabled only for root user, normally you would loginto server as user and then become su. if you would like to use only ssh keys as form of auth. then you need to change 3 lines there totally. I am running out of time as I am leaving to work, but I will come back with some example in evening (sorry)

adelphia - I’m behind a router at my home but I can manage my other sites at multiple hosting companies, just issues with this one

unborn - I just turned on PasswordAuthentication = yes and everything is working.

Thank you for your responses

@wildweaselmi - glad to hear that issue was in ssh config. well for ssh keys setup you need to do those 3 things change in your config. keep in mind that all password logins would be disabled on ssh means you will need only ssh keys:

  • ChallengeResponseAuthentication no
  • PasswordAuthentication no
  • UsePAM no

After saving your changes SSH server must be restarted. Some note: to generate keys: on your computercd /home/your-username/.ssh then run ssh-keygen -t rsa or ssh-keygen -t rsa -b 4096 -C "your_email@domain.com" press 3 times enter - no names, no passwords - then copy it into /home/server-username/.ssh - if folder does not exist create it and set folder permissions to 700 then on local machine run command cat id_rsa.pub >> authorized_keys save file and upload onto server .ssh folder and set file permission to 600 for authorized_keys… restart ssh server once again and you should be done. (local computer = running some linux os not or unix os and this is not valid for windows crapware :wink: )

@adelphia - its common sense that hes hosting outside of home and it means remote install - its AWS EC2 …HELLO??? duh!