如何限制对phpmyadmin的访问? [英] How to restrict access to phpmyadmin?

查看:230
本文介绍了如何限制对phpmyadmin的访问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何保护phpMyAdmin

Possible Duplicate:
How to secure phpMyAdmin

我使用phpmyadmin预览我的网站的数据库.但是,每个人都可以通过简单地输入example.com/phpmyadmin

I use phpmyadmin to preview the database of my website. However, everyone can access the login page of my phpmyadmin by simply typing example.com/phpmyadmin

我不是网络安全专家,但我认为这不是很安全.

I am not an expert in network security but I assume this isn't very secure.

如何限制对登录页面的访问(也许创建一些别名,例如example.com/a4ebb72d). 我听说过只允许访问指定的IP,但这无济于事,因为我已经动态分配了IP.

How can I restrict the access to the login page(maybe creating some alias like example.com/a4ebb72d ). I heard about allowing access only for specified IPs, but it won't help because I have dynamically assigned IP.

感谢您的提示.

推荐答案

我会让服务器在127.0.0.1上侦听,然后将端口转发与SSH一起使用...

I'd make that server listen on 127.0.0.1 and then use port forwarding with SSH...

请确保服务phpMyAdmin的服务器仅服务于127.0.0.1,然后运行

Make sure, the server serving phpMyAdmin only serves to 127.0.0.1, and then run

$ ssh -L4545:localhost:80 yourserver.com

,然后将浏览器指向 http://127.0.0.1:4545/phpmyadmin ,您应该只要您的SSH会话处于活动状态,就可以访问phpmyadmin.您甚至可以制作一个shell脚本来自动执行此操作.

and then point your browser to http://127.0.0.1:4545/phpmyadmin, you should be able to access phpmyadmin as long as your SSH session is active. You can even make a shell script to automate this.

这也适用于PuTTY.

This works with PuTTY as well.

这篇关于如何限制对phpmyadmin的访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆