Weird "Login failed for user 'sa': in Event viewer - sql-server

I'm hosting my web application on an azure VM. I've created a new user for MSSQLSERVER which my application can use to access the remote SQL server on that machine (so i do not use the sa user in my application). I have no problems at all accessing it, but i accidentally opened the Event Viewer and I found that each time I log into my application I get tens of messages that say
"Login failed for user 'sa'. Reason: An error occurred while
evaluating the password. [client: ......]
I first thought that it was an intruder, but then I realized that this message appears once I login to my application.
Why could this message be shown ?

It is a state 1 issue, password validation gets done all-right, the problem is it is disabled for that user, in this case your MSSQLSERVER user or sa.
Try logging in with sa, and log out to refresh credentials . grant all permissions to new user that you created, and log in with your newly created user. This should solve the problem [make sure that error number is either of 18470 or 18456].

Related

SQL Server v14 - Login Failure

We are using SQL server 2014, we update a password for a user login here
we click properties on a given login account and change the password here
we are certain we entering it correctly when we then try to login to the server using the login and password we get the following error
I don't know where else to look and what else to change -- when we do the same process on a different server it works without issue. But here its failing.
Where should we look and what else do we need to troubleshoot. Could it be we don't have access to certain databases, how do we fix this.
These are some of the errors coming through in the system logs
Message
Login failed for user ‘abc’. Reason: Failed to open the explicitly specified database ‘AMS'. [CLIENT---]
Message
Login failed for user 'abc’. Reason: Failed to open the database ‘Budget’ specified in the login properties. [CLIENT: ---]
Message
Login failed for user ‘abc’. Reason: Password did not match that for the login provided. [CLIENT: ----]
You must set a default database where the user AND relative login can access.
Logins are objects with a password
Users are objects, mapped to Logins, added to SQL Server entities.
Under Server -> Security -> Logins
Unser Database -> Security -> Users
Check also if the user is correctly mapped to the login.
To solve your problem you can set the master database as the default for your login.
You can find out more about the error in the SQLServer logs as described here https://learn.microsoft.com/en-us/sql/relational-databases/performance/view-the-sql-server-error-log-sql-server-management-studio?view=sql-server-ver16.
If you are looking for a quick fix to your problem, you can either:
assign more server roles to your login
or grant it an individual permission
use master;
grant CONNECT ANY DATABASE TO <login>;

Reason: Could not find a login matching the name provided

Windows service with logon as domian\user1
Added login to instance with this user, mapped to databases needed.
Connection from service is using windows auth
When it runs, I get this error :
System.Data.Entity.Core.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: Login failed for user domian\user1
Ive tried several things such as net use with the credentials, I know the password is correct.
Checked the spelling, the login matches.
What else?
[ update ]
Looking at the sql log, I see the same thing
Reason: Could not find a login matching the name provided
Its as if this login doesnt exist on the instance

SqlException: Cannot open database

I have problem with the IIS itself it seems that the database could not authenticate. The error shows like this:
SqlException: Cannot open database "dbPEMCOLoan" requested by the login. The login failed.
Login failed for user 'WORKGROUP\IAMPRO$'.
The problem right now is that I don't have any workgroup on my computer. See picture below:
and also here is my connection string:
"ConnectionStrings": {
"PEMCOLoan": "Data Source=IAMPRO;Initial Catalog=dbPEMCOLoan;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=True;ApplicationIntent=ReadWrite;MultiSubnetFailover=False;"
}
I'm a bit new with the asp.net core framework and I'm trying my best to do the research on my own to fix the issue and tried those suggestions but never of them work because I couldn't find the domain WORKGROUP\IAMPRO$ itself.
Any help would be very much appreciated! Thanks!
WORKGROUP\IAMPRO$ is the local machine user account your IIS Application Pool runs and thus is used for Integrated Security (specified in your connection string).
Configure your Application Pool to run under a different user that is already granted access to your database or create a new, dedicated user account.
Using a dedicated user account is considered best practice since it allows to grant the specific privileges needed (on database and OS) and your App will not break when the password of your own user account is changed.

sql server log messages abouts logins

After i logged in to SQL server using management studio i opened the log and i got a million messages showing
Login failed. The login is from an untrusted domain and cannot be used
with Windows authentication. [CLIENT: 222.186.61.5]
or
Login failed for user 'sa'. Reason: Password did not match that for
the login provided. [CLIENT: 222.186.61.5]
or
Login failed for user 'kisadmin'. Reason: Could not find a login
matching the name provided. [CLIENT: 222.186.61.5]
or
Login failed for user 'wwo'. Reason: Could not find a login matching
the name provided. [CLIENT: 104.217.216.169]
I have many more logs for many users and IP's which first appeared 10/6/2015 8:06:19 PM (and i have them everyday). Are these messages showing that i have been cyber attacked ?
What you see is a set of failed login tries, so, you can know for sure that someone tries to hack your database. Unfortunately, if there were successful attempts, then people might have read some data from your part. You need to kill all active connections and change the port you are using for your database.
Also, it would be nice if you would think about how people were able to try to log in to your database. Are you having by accident any public information about where your database server is (like error messages, for example)?

Parallels Plesk Panel unable to connect to database

I don't know how to create a database into Parallels Plesk Panel, so I tried it going to the PhpMyAdmin creating the database and modifying the admin user password from there, but now the system is showing me the next error:
ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.
0: common_func.php3:150
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:107
ERROR: PleskFatalException
Unable to connect to database: saved admin password is incorrect.
0: common_func.php3:150
psaerror(string 'Unable to connect to database: saved admin password is incorrect.')
1: auth.php3:107
What can I do to fix it?
Try to connect to psa database:
mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa
In case you cannot connect, try to update admin user for mysql with this password. After that Plesk should be able to connect with this database.
I also add this problem, for me the above solution didnt work. it appears plesk has been evolving it's password protection (e.g. .psa.shadow is now aes-cbc encrypted)
this kb article worked for me - i'm using plesk 11.09
http://kb.parallels.com/112492
I got myself into this situation when i got a cloud vm instance where i couldnt log into mysql. so i mysqld_safe and updated the admin password to what it was supposed to be, which meant i could log in but I also broke plesk. this kb got plesk back on its feet again
One thing I found; after following these steps I am not able to login to the plesk 'admin' user on the command line, even with the password i specified in the env variable ! so before resetting the admin password as per this kb article, create another mysql user with all privileges. then use the new user so you dont have the problem of sharing a user with plesk
as to why this happens i dont know, i'm interested if someone does. what appears to be happening is that the ch_admin_passwd of psa starts mysql with security disabled, does some operation on the password (obfuscate?, encrypt?, add salt?) and sets that password for the admin user. whatever that interim operation means that while plesk can log into mysql as admin because it's consistent with itself, the cleartext version of the password specified to ch_admin_passwd does not work on the command line with mysql

Resources