23 performance encryption ssh proxy socks
我在使用 openssh(服务器)和 putty(客户端)组合使用远程 webproxy 时遇到了性能问题。我想禁用加密并测试结果以查看它是否有所作为。我怎样才能做到这一点?有什么我可以修改的sshd_config
。我对openssh很陌生。
任何其他想法将不胜感激。
我基本上将我的 IE 设置为使用 127.0.0.1 袜子作为代理。我将我的腻子连接到家里的 openssh 服务器,瞧——我可以通过它浏览互联网。但是,即使我知道我家的连接速度很快(例如,ftp 的工作速度超过 50Kbytes/sec。
ŹV *_*V - 18
不重新编译任何东西,就我所知,它无法完成。但是,您可以切换到 ARC4 或 Blowfish,它们在现代硬件上速度快得离谱。
您可以获得的最佳性能(就时钟周期而言)增加是通过添加
compression no
Run Code Online (Sandbox Code Playgroud)
你可以通过改变来做到这一点
ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
aes256-cbc,arcfour
Run Code Online (Sandbox Code Playgroud)
到
ciphers arcfour,blowfish-cbc
Run Code Online (Sandbox Code Playgroud)
如果你想冒着不兼容的风险挤出一些额外的性能,你可以改变
macs hmac-md5,hmac-sha1,umac-64@openssh.com,
hmac-ripemd160,hmac-sha1-96,hmac-md5-96
Run Code Online (Sandbox Code Playgroud)
到
macs hmac-md5-96
Run Code Online (Sandbox Code Playgroud)
如果您仍然认为这开销太大,您可以恢复到 v1 或仅使用标准 VPN。
除非客户端或服务器的功能严重不足,否则我非常怀疑是加密导致了您的性能问题。我经常使用“-D 8080”ssh 袜子代理,除了非常轻微的减速之外从未注意到任何事情。
要检查的一件事是查看客户端和服务器之间的延迟。如果它是一个非常隐蔽的连接,您肯定会在使用 HTTP 时看到隧道性能不佳,而不会看到 FTP 的性能问题。一旦进行 FTP 传输,延迟并不重要,但是对于 HTTP,您处理的网页可能需要进行 50 次或更多次单独的 HTTP 握手。高延迟连接确实会减慢这个过程,并使浏览变得难以忍受。
所以无论如何,Zephyr Pellerin 提出的建议是合理的。如果您确实认为是加密导致了问题,请切换到不同的密码。不过,我建议先研究延迟,因为这似乎是一个更有可能的候选者。
小智 6
这个线程让我做了我自己的基准测试,我发现性能不仅因不同的密码/MAC 而异,它还影响您发送的数据、涉及的 CPU 以及网络的设置方式。
因此,IMO 正确的做法是运行您自己的测试并找到适合您情况的最佳设置。
如果有人感兴趣,以下是我将英特尔 E5506 驱动的服务器与 Raspberry Pi 进行比较的测试结果:
--
-- Intel Xeon E5506(4 x 2.13 GHz), 50MB Random binary Data over localhost
--
cipher mac speed
---------------------------------------------------------------
aes192-cbc hmac-sha1 50MB/s
arcfour256 hmac-sha2-512 49.9MB/s
arcfour hmac-ripemd160 49.8MB/s
aes256-cbc hmac-sha1-96 49.7MB/s
aes128-cbc hmac-sha1-96 49.7MB/s
aes192-cbc hmac-sha1 48.9MB/s
arcfour hmac-ripemd160@openssh.com 48.8MB/s
aes256-cbc hmac-sha1-96 48.8MB/s
arcfour hmac-ripemd160@openssh.com 48.7MB/s
aes128-cbc hmac-sha1 48.4MB/s
--
-- Raspberry PI B+, 10MB Random binary over localhost
--
cipher mac speed
---------------------------------------------------------------
arcfour256 umac-64@openssh.com 2.75MB/s
arcfour128 umac-64@openssh.com 2.74MB/s
arcfour umac-64@openssh.com 2.63MB/s
arcfour umac-64@openssh.com 2.54MB/s
arcfour hmac-md5-96 2.36MB/s
arcfour128 hmac-md5 2.34MB/s
arcfour256 hmac-md5 2.34MB/s
arcfour256 umac-64@openssh.com 2.33MB/s
arcfour256 hmac-md5-96 2.28MB/s
arcfour256 hmac-md5-96 2.22MB/s
Run Code Online (Sandbox Code Playgroud)
但只要是“前 10 名”,就可以在此处找到完整的结果。
小智 5
在这篇文章的帮助下,我能够使用密码“none”编译 sshd/ssh: https://bugs.debian.org/cgi-bin/bugreport.cgi ?bug=24559#58
这是一篇非常老的帖子,但是您必须对源代码文件 cipher.c 进行 3 处细微修改。然后重新编译sshd/ssh代码。
@@ -175,7 +175,7 @@
for ((p = strsep(&cp, CIPHER_SEP)); p && *p != '\0';
(p = strsep(&cp, CIPHER_SEP))) {
c = cipher_by_name(p);
- if (c == NULL || c->number != SSH_CIPHER_SSH2) {
+ if (c == NULL || (c->number != SSH_CIPHER_SSH2 && c->number != SSH_CIPHER_NONE)) {
debug("bad cipher %s [%s]", p, names);
xfree(ciphers);
return 0;
@@ -343,6 +343,7 @@
int evplen;
switch (c->number) {
+ case SSH_CIPHER_NONE:
case SSH_CIPHER_SSH2:
case SSH_CIPHER_DES:
case SSH_CIPHER_BLOWFISH:
@@ -377,6 +378,7 @@
int evplen = 0;
switch (c->number) {
+ case SSH_CIPHER_NONE:
case SSH_CIPHER_SSH2:
case SSH_CIPHER_DES:
case SSH_CIPHER_BLOWFISH:
Run Code Online (Sandbox Code Playgroud)
此外,none
密码需要添加到您的/etc/ssh/sshd_config
Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr,none
Run Code Online (Sandbox Code Playgroud)
下面的链接将帮助您获取 Debian 和 Ubuntu 系统的 ssh 源代码:
感谢 Dean Gaudet 的出色表现
归档时间: |
|
查看次数: |
57410 次 |
最近记录: |