简体   繁体   English

如何通过命令行防止在Win或Unix上运行程序

[英]How to prevent running program on Win or Unix via command line

After a long research here on Stackoverflow and on net I didn't found nothing talking about it. 在这里对Stackoverflow和网络进行了长期研究之后,我没有发现任何关于它的信息。 As the title say, how can I do that? 如标题所述,我该怎么做?

For example: I am owner of a hosted website that allow me to manage the database via PhpMyAdmin. 例如:我是托管网站的所有者,允许我通过PhpMyAdmin管理数据库。 When I try to connect to my database via prompt, the connection never go fine. 当我尝试通过提示符连接到数据库时,连接永远无法正常运行。 It could be because of OS settings (right?). 可能是因为操作系统设置(对吗?)。

How can I do that (in both OSs). 我该怎么做(在两个操作系统中)。

Thanks in advance. 提前致谢。

If I understand your question correctly: 如果我正确理解您的问题:

You have a website with a MySql database hosted on your providers servers. 您有一个在提供程序服务器上托管有MySql数据库的网站。

When you try to use your local PC installation of MySql from a command prompt, it will not let you connect. 当您尝试从命令提示符下使用MySql的本地PC安装时,它将无法连接。

I use dreamhost.com and have a similar setup. 我使用dreamhost.com并进行了类似的设置。 If I want to use database tools from my local PC to connect to the database, I have to enter my IP address in the db configuration page under "allowed hosts". 如果要使用本地PC上的数据库工具连接数据库,则必须在db配置页面的“允许的主机”下输入IP地址。

Restricting remote database connections to specific IP addresses protects your database from random hacking attempts. 将远程数据库连接限制为特定的IP地址可以保护您的数据库免受随机黑客的攻击。

As for your question about restricting command line execution of a program, that is usually just caused by missing configuration information in the environment variables - leaving the path to the executable out of the PATH variable is a common one. 关于限制程序的命令行执行的问题,通常是由于环境变量中缺少配置信息引起的-将可执行文件的路径留在PATH变量之外是很常见的。 You would still be able to run the program if you enter the full path to it. 如果输入程序的完整路径,您仍然可以运行该程序。

It really depends on the error message you get when trying to run the program from the command line. 这实际上取决于您尝试从命令行运行程序时收到的错误消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM