Kamailio not connects to remote database - kamailio

I have Kamailio on ubuntu at 10.10.145.189 and mysql on centos at 10.10.118.91.
While installing kamailio, the command
/usr/local/sbin/kamdbctl create
worked and all databases created on 10.10.118.91 without any issue.
But when i try commands like
kamctl db show subscriber
it responds with error as follows.
ERROR 1045 (28000): Access denied for user 'kamailioro'#'ip-10-10-145-189.ec2.internal' (using password: YES)
10-10-145-189.ec2.internal was its hostname.

Solved it by creating database users kamailio and kamailioro with host any.

With the default configuration of kamctctlrc, /usr/local/sbin/kamdbctl create will create the user kamailio in the mysql db with localhost and the IP of the mysql server as the Host. After that when you use the command kamctl it tries to access the mysql db with kamailio#"IP_of_kamailio_server" and hence the access is denied.
Try changing in the kamctctlrc file
DBACCESSHOST=IP_of_kamailio_server to access the DB from the kamailio server
or
DBACCESSHOST=% to access the DB from any host for the user kamilio
and then create the schema in the DB /usr/local/sbin/kamdbctl create

Related

MariaDB: root access from network means also from SSH?

During the securing of MariaDB it asks me the following question:
Disallow root login remotely? [Y/n]
Normally, root should only be allowed to connect from 'localhost'.
This ensures that someone cannot guess at the root password from the
network.
Because I'm working on a headless server (Ubuntu Server) without any screen nor keyboard, my only way to reach the o.s. is via SSH.
Disabling the remote root login will prevent me to access from SSH as well? I guess yes, and I kept the remote login enabled.
It's the default admin account of MariaDB, has same name with system root account, but there's no direct relationship between them. System user bob can also use command mysql -uroot -p to connect MariaDB with admin privilege.
login remotely means connecting to MariaDB remotely using port 3306. if remote login is enabled for root and MariaDB bind a public IP, anyone can try to connect to your DB by mysql -uroot -hIP. then a security incident happened if weak password used.
Disallow root login remotely? [Y/n]
That's from MariaDB perspective, NOT the SSH.
When you are login via SSH and then login to MariaDB via mysql cli to localhost server, MariaDB assume that you login "locally".
As like many other RDBMS, MariaDB allow to login remotely, in your case without SSH, to any remote server via TCP/IP. This kind of login to MariaDB is the meaning about above question.
Example:
You are now at Host A (IP: 192.168.0.10). The MariaDB server at Host B (IP: 192.168.0.11).
If you are accessing the MariaDB server via mysql client cli and execute:
mysql -h192.168.0.11 -uroot -p
That's called "root login remotely"

What is the configuration for setting up MySQL workbench with a AWS Bitnami instance?

I am some issue with connecting the pipes between MySQL Workbench and my Bitnami Wordpress instance on AWS (using ssh). I have read and attempted the docs several times, I don't know what is going on.
I have successfully ssh-ed via the command line using ssh -i my_key_file bitnami#IP-Address.
However, I cannot get it to work for MySQL Workbench.
Field Value
SSH Hostname IP-Address
SSH Username bitnami
SSH Key File <path-to-key-file>
MySQL Hostname 127.0.0.1
MySQL Server Port 3306
MySQL username root
The path to key-file is correct as it works for other AWS instances. And the SSH hostname and SSH username get my access via the terminal - so I would assume these are fine?
When I test the connection, I am prompted for a password. Everywhere online suggests that this password is the admin password used the Wordpress account (accessible via the system logs). I have this password. However, this doesn't get me in.
The attempted connection returns the error: Failed to Connect to MySQL at 127.0.0.1:3306 through SSH tunnel at bitnami#IP-Address with user root
Any help would be appreciated
I have read and attempted the docs several times, I don't know what is going on.
I guess you are referring to this documentation
Could you try to reset the password for the root user as described in the guide below?
https://docs.bitnami.com/aws/components/mysql/#how-to-reset-the-mysql-root-password
Once you have restarted it and you have chosen a new one, use this new password on the Workbench.

Unable to connect to destination server using jenkins. Able to do it from (putty) terminal

I am trying to connect to remote server from jenkins. Have followed the procedure to create the public/private pass key and copied them to the remote server as well.
changed the permissions to the .ssh/ authorized_keys.
Can successfully access using terminal (putty), doesn't ask for password.
jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config [Jboss Dev]. Message [Auth fail]

How to access remote sql server located in other place

I have shared published website and the database files to our client.
they have restored the database to their server.
Now they have changed the connection string in web.config with new server name/IP address and a proper user name and password.
My client said that he can login sql server using the same password and username. But when the website is launched through IIS with same (username and password in web.config and same db structure), it gives an error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=53&LinkId=20476
Error Number: 53
Severity: 20
State: 0
The ip address of the server starts with 172.
Any help would be highly appreciated.
I would check these things:
I would check the SQL Server Configuration Manager to see if the TCP/IP communication is enabled.
I would check the firewall settings. A firewall could prevent traffic from/to the server.
I would check if another application from the same client can connect to the same server. Then I would check the connection string differences.
If all of the above were playing correctly, then I would check the privileges on the specific SQL Server, on the specific database, for the account I am trying to connect with. Allow everyone to use this database as a first step to check if it is an account-permissions problem.
You could check this connection strings example post.
Hope I helped!

Why I am not able to connect to remote SQL Server from asp.net website whereas it is connecting from SQL Server Management Studio

Why I am not able to connect to remote server from asp.net website whereas it is connecting from SSMS
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I tried all the possible solution suggested in this link
I checked Followings as given in the above article, they are enabled/running
SQL Server is up and running.
TCP/IP enabled in SSCM
Opened port in Windows Firewall
Remote Connection enabled
SQL Server Browser Service running
I searched for sqlbrowser.exe but it is not found in the given directory.
Finally I switched off Windows Firewall but still it is not working.
UPDATE: we are connecting to sql server using a custom user created on sql server (not sa )
I have user account credential to Remote connect to server.
I tried to change LogOn to my credentials (administrator) . in Windows Services SQL Server (MSSQlServer) and SQL Server Agent (MSSQL Server) services.
Double check your connection string - are you connecting to a hostname that needs to be added to your Hosts file? For example "dev-sql1" but without a matching entry in dns or hosts file.
If you have created a custom user, can you check if logins are disabled for the user?
In SSMS, goto Security, right click user, Properties -> Status, Login - Enabled.
Hope this should fix it.
Three possibilities and they are not mutually exclusive.
Most hosting providers disable remote connections to SQL servers. Check with RackSpace if blocking port 1433
The SQL Server needs to be reconfigured to accept remote connections. See http://support.microsoft.com/kb/914277
You have to use a different connection string. See http://www.connectionstrings.com/sql-server and look for Connect via an IP address
I got the same issue but with mysql server. Rack space had two mysql server address. One for connecting from outside their local network and one for connecting from inside the network. you will have to use the address that is required to connect from inside the network.

Resources