Unable to access server database with datagrip - 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

Related

Server refused our key

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.

MobaXterm use ssh passwords for server authentification

I want to create a MobaXterm user session to access a server via ssh.
I use a username and password for authentication. The option using the ssh key is unfortunately not available to me.
Furthermore, access to the server takes place via a jump server which is also protected with a username and password.
Under "Settings > Configuration > MobaXterm passwords management" I enabled "save ssh keys passphrases as well" and set "ask" for saving session passwords.
In the credentials section I created both credentials for accessing the servers with the requested username, password and as name the ip addr of the server.
How can I configure my user session to use these credentials to connect to the servers?

psql: FATAL: password authentication failed for user windows 8

I installed postgresql on windows and while the installation it asks to make a user for the account.This made a new windows user in my computer called postgres, I have created a password for it as well.
Now I want to run psql on windows command line, it asks for a password (without mentioning the user) and always gives me back the error: psql: FATAL: password authentication failed for user "Ash". Even though I have put my accounts password many times.
using pgadmin I changed the user "postgres" to "Ash" but I have yet to remake the password. I followed the steps here: I forgot the password I entered during postgres installation (I rather types host all 127.0.0.1/32 trust because I am on windows), but when running psql again so that I can change the password I get the error: psql FATAL:could not load pg_hba.conf. All together.
Why can it not load? All I did was add an extra authentication option.
Also, is the windows user separated from a postresql user or are they the same(depend on each other)?
Edit:
As you can see, it did not give me the option to choose if Aisha should be a superuser or not. or the other options for that matter.
I also used pgadmin||| to create a new user but the same error pops up:
The user does not exist so why does it do this?
The user on your machine has nothing to do with the user on PostgreSQL. The installer just creates an account and a PostgreSQL role with the same name and password (which in my mind is a bad idea), but they're not related in any way. The Windows user is used to run the server, the PostgreSQL role is used inside the database.
So you should first access the server with the user postgres and then create a user for yourself. Don't change the username inside the server, or the server's running user! Just create a new username and grant it the permissions you need.
You can use psql -U postgres to connect to the server and it'll ask for the password.
Check the permissions for pg_hba.conf, the postgres user must have permissions for it. If you only edited it as an admin, it should be ok, but if you took permissions or anything else, it may mess it up.
createuser is a command-line utility. Use CREATE USER username WITH PASSWORD 'fred'; or similar at the SQL level in psql. Note the semicolon.
What you're doing in your screenshot is starting to write an SQL command beginning with createuser, but never sending it to the server to run because there's no semicolon terminator. So you never get the error that would tell you it doesn't make sense to do that.
I had exactly the same problem and this line solved it;
createuser --createdb -U postgres --login -P 'your_new_user'
#sami-kuhmonen was right, but his approach of solving the problem did not work for me.
This can also happen if the encryption for stored passwords does not match the encryption for connections as defined in postgresql.conf ang pg_hba.conf
For example, if postgresql.conf has:
password_encryption = md5
but pg_hba.conf has:
host all all 10.0.0.110/24 scram-sha-256
Then all connections on the 10.0.0.110 interface will have the 'FATAL: password authentication failed error'.
Remember that if you change either of these files you will need to restart postgresql and if you change the password encryption in postgresql.conf you will need to change the passwords for all of the users.
Hope this helps some others with this problems.
I was having the same error. I get to solve it by locating the "pg_hba.conf" file. You can use this navigation:
C:\Program Files\PostgreSQL\14\data\pg_hba.conf
Then inside the file, changed all the methods "scram-sha-256" to trust and problem was solved.

Recovering RDP access to potentially compromised GCE Windows 2008 R2 server

I have a Windows 2008R2 server in GCE that is behaving oddly (may be compromised). I can no longer access it via RDP. When I reboot the machine and look at the serial console, I see at the very bottom after the boot sequence, that something called Credentials Manager runs and appears to delete or change some username/password. I suspect that this is what is changing the RDP password. (see image attached). On a normally running Windows VM, I do not see this in the trace.
GCE Agent started.
Starting AddressManager
Starting CredentialsManager
Credentials have changed. Updating...
Changing username...
Deleting old user...
Username or password was updated successfully.```
I have tried resetting or adding a new password using the metadata windows-startup-script-cmd = net user but that does not seem to do anything.
What I get is an error message of the form:
Booting on date 05/05/2015 10:22:49
WARNING: Computer Name windows does not match Compute Engine Instance Name XXXXX.
Did you forget to run gcesysprep?
attributes/windows-startup-script-bat value is not set or metadata server is not reachable.
attributes/windows-startup-script-ps1 value is not set or metadata server is not reachable.
So the question is, how can I get into the machine to see what is happening? Is there a way that the GCE startup sequence could be changed to not call the credential manager to change the password or username?
What you could do is if you have a Gcloud SDK (https://cloud.google.com/compute/docs/gcloud-compute/) installed, you can run the following command while that instance is running:
gcloud compute instances decribe instance_name
This will provide all the information about the instance and you will see a section called MetaData which will display the users and the passwords. Then you can try to remote in and remove any credentials setup in the Credentials Manager located in Control Panel -> User Accounts.
I hope this give you access to your VM

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