ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    MariaDB - Remote connections from specific IP

    IT Discussion
    mariadb
    3
    8
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AdamFA
      AdamF
      last edited by AdamF

      I have a hosted Maria DB. (SuiteCRM) I need to grant access (read only) to the specific SuiteCRM database, to a specific user (new user) so that he can generate some reports off of the data. Ideally, I would like to restrict access to his specific IP, or just a few select IPs.

      I've created a user in MariaDB, and granted the user Select access. What is the best way and procedure, to allow this user remote access to the DB securely?

      It's been a while since I've worked in detail with MariaDB, so I'm not sure what the best approach is, or what the procedure is. Any help would be appreciated.

      Thanks!

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        Create a dedicated user account for him/her in the database so that he/she has to authenticate for read only access.

        Use the firewall to control access to Port 3306 so that only the proper locations can talk to MariaDB at all.

        AdamFA 1 Reply Last reply Reply Quote 0
        • scottalanmillerS
          scottalanmiller
          last edited by

          For even more security, add SSL certifications.

          https://www.cyberciti.biz/faq/how-to-setup-mariadb-ssl-and-secure-connections-from-clients/

          1 Reply Last reply Reply Quote 0
          • AdamFA
            AdamF @scottalanmiller
            last edited by

            @scottalanmiller said in MariaDB - Remote connections from specific IP:

            Create a dedicated user account for him/her in the database so that he/she has to authenticate for read only access.

            Use the firewall to control access to Port 3306 so that only the proper locations can talk to MariaDB at all.

            OK, so it looks like I'm not missing anything in my thought process. Just create the RO user, then open up firewall port to select IPs. I'm using FirewallD, so I would grant access like this:?

            firewall-cmd --zone=public --add-service=mysql --permanent

            firewall-cmd --add-rich-rule 'rule family="ipv4" source address="xxx.xxx.xxx.xxx" service name="mysql" accept' --permanent

            1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller
              last edited by

              Looks right.

              AdamFA 1 Reply Last reply Reply Quote 0
              • AdamFA
                AdamF @scottalanmiller
                last edited by

                @scottalanmiller Well that worked, but it looks like I can connect from any IP, not just the one I specified. Digging further.....

                JaredBuschJ 1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @AdamF
                  last edited by

                  @fuznutz04 said in MariaDB - Remote connections from specific IP:

                  @scottalanmiller Well that worked, but it looks like I can connect from any IP, not just the one I specified. Digging further.....

                  You don't want that first rule. That opened it to everything. You only want the second.

                  AdamFA 1 Reply Last reply Reply Quote 0
                  • AdamFA
                    AdamF @JaredBusch
                    last edited by

                    @jaredbusch said in MariaDB - Remote connections from specific IP:

                    @fuznutz04 said in MariaDB - Remote connections from specific IP:

                    @scottalanmiller Well that worked, but it looks like I can connect from any IP, not just the one I specified. Digging further.....

                    You don't want that first rule. That opened it to everything. You only want the second.

                    Bingo. Thanks!

                    1 Reply Last reply Reply Quote 0
                    • 1 / 1
                    • First post
                      Last post