Hardware: VPS bought online: AWS EC2 Instance YunoHost version: latest by the time writing this 22.214.171.124 (stable) I have access to my server : No access to server through SSH after installing and rebooting the server, I can manage to get in through AWS serial interface only. Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : NO, right after installation. If yes, please explain:
Description of my issue
I have tried a couple of times, I setup my EC2 instance on AWS, and like all my other instances I can access them through SSH via keypairs instead of password for security purposes, and simply by:
The issue is whenever I install YunoHost that access won’t work anymore, I tired several times and selecting not to touch any SSH configurations and keep the current one, no luck, the moment I reboot the instance it won’t work, even if write the “admin” password that were done in the post-install, I’m not able to access through SSH, not by the key nor by the password. I did confirm the password is working though by accessing the instance through serial interface, so it must be something done through the installation that might miss up the SSM agent? have anyone had same issue?
Again, I want to keep the keypair access so even if the SSH worked through the password, it is not the solution I’m looking for.
To add, if I tried to SSH into the server using the admin/password created in post-installation, I get permission denied.
So here’s the update if anyone faced the same problem
-Launch the EC2 instance with all configs per your policy/wizard
-Get the pairkey generated
-Install YUNOHost, choose not to modify the any ssh configs by YUNOhost
-Once done, do not reboot, if you do, login to the server using the serial interface, user is admin, password is what you setup in the post install
-Now in your machine (your laptop for example not the EC2 instance), gnerate a new public key from the private you already have when you created the instance, to generate the public key do
ssh-keygen -y -f your_EC2_key.pem
-It will get you a new pulic one, now go to your EC2 instance to the location below and replace the public one there with what you have generated now
And that should work, you can also create a profile by ssh-add so you don’t have to write the user every time with ssh -i
It looks like that public key work with user root but YUNohost change it admin and hence it doesn’t work, or maybe something else but that worked in my case.