I'm trying to connect to OpenLDAP using Laravel. All I did was follow the https://ldaprecord.com/docs/laravel/v1/ tutorial. But this tutorial only connect to trial LDAP. I need to connect to my localhost openLDAP.
I'm using these .env configs:
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_HOST=127.0.0.1
LDAP_USERNAME=null
LDAP_PASSWORD=null
LDAP_PORT=10389
LDAP_BASE_DN="dc=example,dc=com"
LDAP_TIMEOUT=5
LDAP_SSL=false
LDAP_TLS=false
Ldap connection test comes successful. But when I try to login using UI, I get that credentials are wrong. i only have created one user so cant be wrong.
From the documentation: "To connect to your LDAP server, a username and password is required to be able to query and run operations on your server(s)."
So you need to enter a (proxy) username and password at the LDAP_USERNAME and LDAP_PASSWORD prompts in order for the application to be able to interact with the LDAP server.
My guess is that you need to enter the user DN and not the short username: uid=username,ou=people,dc=example,dc=com or similar
Related
I tried new connection via:
$conn = new PDO("sqlsrv:server=SERVERNAME;database=DBNAME;MultipleActiveResultSets=false", "username", "password");
and it did not work, however when I remove the username and password it works fine.
username is the same as my windows login, I tried multiple combinations as DOMAIN\username or username#domain.com etc, nothing works. However when username and password are not present, then it connects fine.
The error is:
SQLSTATE[28000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'username'.
so to my question, in order to debug the problem.
Is it possible to check what username is used when automatic authentication is used after the login succeed?
EDIT: so once upon login without username and pass i tried:
Select name FROM DBNAME.sys.syslogins
and it gave me "DOMAIN\USERNAME"
I have tried that several times even before, but still same error :(
EDIT2: is it in db loginlist authorization? I have tried SQL Studio to log in via Windows authentication - works fine, however when i sqich to SQL server authentication and use the correct username and password, it gives me same error again, like the username is not existing anymore...
So at the end, I have found out that one account can not be set to log in via SQL authentication and windows authentication as well. So If I can login via windows authentication (no username and pass entered), then only way is to create new account with same username and set it as SQL Authentication upon Login.
Please correct me if Im wrong (and mainly someone who can test otherwise - because i have found security setting to the account which says "SQL Server and Windows Authentication mode" which is active anyway but doesnt work, and according to our database admin, this setting is not what its for)
Hi I am using the code below to retrieve client username on my website but it only works for me on localhost, other people connected remotely to the file its just finding nothing with no errors or anything.
exec("wmic /node:$_SERVER[REMOTE_ADDR] COMPUTERSYSTEM Get UserName", $user);
echo($user[1]);
What is the problem ?
For a remote system you may need to send administrator credentials, e.g.
exec("wmic /node:$_SERVER[REMOTE_ADDR] /user:administrator /password:mypassword COMPUTERSYSTEM Get UserName", $user);
echo($user[1]);
I'd also research if safe to trust REMOTE_ADDR and use it in this way with wmic.
If you are using IIS and looking to get the remote users AD username, this may help: Can you get a Windows (AD) username in PHP?
I have a mongoDB server using v2.4.9. I need to connect to that server using robomongo in my localhost.
I have enabled auth=true in /etc/mongobd.conf and I have added the username and password in mongodb.php. When I login using robomongo to the remote server, it is connecting already through IP even though I have not prescribed anything in Authentication tab in robomongo. I want robomongo not to connect only through IP, but through both IP and username and password.
How can I do this?
have you created the user with specifications of role and databaseName etc. in robomongo Refer to this link->
https://docs.mongodb.com/manual/reference/method/db.createUser/
I have two servers. For example1.com and example2.com
At example1.com server I have my php code and example2.com there is a postgreSQL database.
Now I want to connect postgreSQL through a tunnel in example1.com
I tried the following command at example1.com server.
ssh -L 5433:localhost:5432 user#example2.com
Then it will prompt for password and I enter the password and login to ssh, then I am trying to connect to database localhost:5433 post but I am getting 'password authentication failed'.
How do I connect to example1.com through ssh?
You need to check the pg_hba.conf on your PostgreSQL server. It probably requires password authentication for TCP/IP connections coming from localhost. So you either need to change that, or set a password for your database user and enter that.
I get this error message
Access denied for user 'user'#'localhost' (using password: YES)
I tried to access with the root, the admin account and some user account I made for the web visitors with a few privileges. Those users (admin and web user) were created with cPanel.
I'm testing the connection with this simple code to avoid making a mess with functional code.
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
?>
I stumbled with this explanation but it doesn't work either
Your cPanel username and password can be used to connect to your databases (as well as your cPanel). If you're connecting to your database using your cPanel username and password, you can reset your cPanel password to ensure you are using the correct username and password.
If you setup a MySQL username and password specifically for accessing a database, you'll want to ensure you are using the correct username in your php scripts. For example, MySQL usernames are always in this format:
cpanel-username_mysql-username
If your cPanel username is userna5 and you created a database username of dbuser1, then the actual database username would be:
userna5_dbuser1
Edit: i already assigned the users to a database and their privileges. I'm working on a remote server
I faced the exact same issue on one of my employees' Windows PC.
The issue was caused duo the fact that his private repositories folders including those who were used by Docker were located in C:\Users{user_name} folder.
At some point in time, Windows prevented Docker's access to these folders.
Solution: relocation the folders outside the Users folder solved the issue.
Are you running the code on your local machine or on the remote server. If it's running on your local machine you'll have to replace 'localhost' with the ip address of the server eg. '123.123.123.123'
If you are using the online server after creating the user and the database make sure you give the user privilege to access the database
If you are accessing MySQL database from the remote server, you will have to use server IP address for MySQL host. Also you will have to allow your remote server IP address in "Remote MySQL" under your cPanel otherwise you will not be able to access your database remotely.