Home  >  Article  >  Database  >  内网ssh/mysql登录缓慢的解决方法

内网ssh/mysql登录缓慢的解决方法

WBOY
WBOYOriginal
2016-06-07 17:55:33806browse

本文介绍了“内网ssh/mysql登录缓慢的解决方法”,需要的朋友可以参考一下

常公司的开发环境都会布置在内网,然后会有公共的服务器让大家在上面进行开发,测试,所以经常会有ssh连接服务器,或者本地mysql client连接服务器的需求,我个人经历过的公司经常会发生ssh/mysql连接公共服务器非常慢的现象,这是由于ssh服务和mysql服务默认都会在登录时进行DNS反向解析的过程,而内网通常我们没有配备DNS服务,那么这时就只能等这些服务自己超时,然后才能允许我们的登录通过,解决方案也很简单,只要关闭相应服务的解析就行了。

首先是ssh,如下:

/etc/ssh/sshd_config

UseDNS no

GSSAPIAuthentication no

GSSAPICleanupCredentials yes

其次是mysql服务:

/etc/my.ini

[mysqld]

skip-name-resolve

skip-grant-tables

如此就行了,重启我们的ssh和mysql服务,再次ssh/mysql连接就能很快了

当然,线上机器我们还是需要打开这些安全机制的

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn