Server refused our key - amazon-ec2

I have created a fresh Ubuntu machine and I have created a new .pem file after that I have loaded that .pem in "Puttykey Generator" and I have selected save as a private file, So successfully key creation has been completed. And I have tried to login into the "Putty" and given user name has ubuntu & tried root as well but getting server refused our key.

when you create a Linux system on AWS you have to choose a Keypair to associate with it. If you don't have one you create it beforehand. That is the ssh private key you need when you log in to that machine.

Related

Unable to access server database with datagrip

I've updated my datagrip to 2021.3.1 and now I'm having an issue where I can no longer access the database from a server.
in my SSH Configurations I filled it in with the correct Host, Port, User name. I've chosen the Key pair as my Authentication type.
The issue I'm having is that when I try to test the connection a popup comes and asks me to Log into the server but it asks for the password for
the id_rsa but I'm using a different ppk to access the database which is already specified in the SSH Configurations

Can a server have more than one SSH key pair?

I have an EC2 server on AWS. I created a key pair upon first time connecting to the server (following whatever default steps on the console).
Now I want to login to the same server from a different machine. What is the best way to do so? Do I have to email my public key to the other machine?
I tried to create more key pairs on the AWS console, but can't figure out to additional key pairs to the server. Is that even possible?
Update:
This is not a duplicate question. My goal is not to associate two key pairs with one server. I am trying to find a way to login to a server from a different computer, whether to use the same key pair, another key pair or even a different user.
When an Amazon EC2 instance is launched from an Amazon Linux AMI (and several other Linux AMIs, too), the public half of the keypair selected at launched will automatically be copied to:
/home/users/ec2-user/.ssh/authorized_keys
When you later attempt to login to the ec2-user by providing the private half of the keypair, the two halves will be compared and, if they match, you will be permitted to login as that user.
You can allow another person to login to the ec2-user by either:
Giving them the same private keypair (bad for security), OR
By creating a keypair for them (via ssh-keygen) and adding the public half of that keypair to the above file
Alternatively, you could create a new user on the machine for them, then add the keypair to the above file within their user directory.
See: Add New User Accounts with SSH Access to a Linux Instance
So, to login to that EC2 instance from a different computer, you will need the private keypair on that different computer. It's just like a password.
Or, you could create a new keypair on that computer and copy the public keypair to the authorized_keys file on the target instance.
All of this is really Linux stuff, rather than something specific to Amazon EC2.
It is not possible to create multiple key pairs for an ec2 server; however you can create multiple users and through that give access.
Id advice creating multiple users and giving access via ssh with key authentication. I have included a link below with the walkthrough.
With that being said you Create a new user, then
allocate permissions and privileges. Next you generate a key - certificate. And finally, you associate the certificate to the user.
https://debian-administration.org/article/530/SSH_with_authentication_key_instead_of_password

I can't access my bitnami server using ppk

Can someone help me fix this issue. I am connected few hours before but then when I tried to rename a folder using Putty I got disconnected and got this error.
Error: Disconnected: No supported authentication methods available (server sent: publickey)
I've tried the following solutions I got from the net.
- Re-gen private key
- Convert .pem to .ppk
- Move .ppk to other folder that all user has permission
- Use the ff username user,root,bitnami,ec2-user
- I tried it in Cyberduck, Winscp, filezilla, Putty
Thank you I hope someone can help me.
bitnami developer here.
Depending on which platform you are working you could download again the .pem file in order to connect to your server.
If you are working on any of our launchpads (https://aws.bitnami.com/, https://google.bitnami.com/, etc.) you have the option
to download you .pem key, so it's not necessary to regenerate the key.
On the other hand, if you are working on the amazon ec2 console and you did not download the private key pair of your server in the moment of the creation of the machine you won't be able to connect to it again unless you create another machine.
In order to reconnect to the server you should download again the key files and use it with putty/filezilla/etc. Make sure you put the correct ip of the server or you won't have access to it.

Not able to login with ssh in AWS ec2 bitnami Instance

I am not able to login with AWS ec2 Bitnami instance.
I have created new keypair for the ec2-instance and i have converted the keypair into ppk with the puttygen.
I have tried to use the login with the different user name like bitnami, ec2-user, ubuntu, root but i cant get any success i have read many blogs amazon document, bitnami document but and apply there that process but still not get success.
I have created new user group and provided access for the ssh, http, https with there defult port.
Server Details.
Instance type : m1.small
Description : https://bitnami.com
Status : available
Platform : Ubuntu
Image Size : 10GB
Visibility : Public
bitnami-magento-1.9.0.1-0-linux-ubuntu-12.04.4-x86_64-ebs
Whenever i am trying to login with the ssh i get the error message.
Disconnected: No supported authentication methods available (server sent: publickey)
Help is very much appreciated.
Thanks
This looks like your public key file is got some issue. I am guessing it should be the puTTY bug which requires an extra newline character at the end of the key file.
When creating the public key, open it in puTTYgen and copy and paste (this will make the key to be formatted in one line along with a newline) it to your authorized_keys and try to login.
For more information, read a similar question

How to connect to AWS EC2 instance using filezillla?

I have AWS EC2 instance. I am using filezilla 3.8.0 but I cannot connect instance, filezilla doesnt accept account type normal and asking password. When I type user name ubunbu and password blank I received following message:
Disconnected: No supported authentication methods available (server sent: publickey)
I inserted pem key and converted ppk key also. My staff can connect but I cant. What is wrong?
Thanks
It happens in AWS EC2. As EC2 provide Connection through an SFTP need some other methods.
Firstly the CONNECTION will be in FTP as default. Need to change to SFTP.
Then instead of directly giving host name and password, it must be done in Site manager. Step by step procedure given below:
So the steps for troubleshooting:
Go to Filezilla's Settings
SFTP
Add Key File (Give the ppk converted key file or FZ will convert the pem ket)
Then take File in Filezilla
Go to
File
Site Manager
New Site
Give any name (ec2-amazon)
In General, give host name 'Public DNS' (eg: ec2-34-423.ap-southeast...)
Change the Protocol to SFTP
Logon Type: Normal
User : ec2-user or ubuntu - depends
Clear Password
Connect!
Hope you will be connected. Happy Hosting...:)
More specifically here's a screenshot of the dialog where you are supposed to add your ssh private key.
Try the following configuration in filezilla,
set Logon type = Interactive,Protocal = SFTP, and attach keyfile to filezilla SFTP setting from MenuBar -> Edit -> Settings ->SFTP -> Add Key File.
Hope this helps.
I was facing the same problem-
I follow up #Amith Ajith answer but found my setting was as it, is.
I choose a file as privatekey.pem which i generated.
Change "Transfer setting" as active
it worked for me.

Resources