SSH para o Cygwin demora a responder

6

Eu tenho uma máquina Cygwin que roda o sshd. Quando tento fazer o login da máquina com o SSH, demora um pouco para obter uma resposta.

Com o comando ssh -v user@cygwin , vejo que há dois comandos que levam minutos.

debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to pspc [10.0.40.177] port 22.
debug1: Connection established.
debug1: identity file /Users/smcho/.ssh/identity type -1
debug1: identity file /Users/smcho/.ssh/id_rsa type -1
debug1: identity file /Users/smcho/.ssh/id_dsa type -1 <---

e

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
debug1: SSH2_MSG_KEXINIT sent <---

Depois de algumas pesquisas, acho que é causado pela porta do windows 113 ter um firewall. ( link )

Como posso resolver este problema? Como posso voltar de identify e SSH2_...IT sent rapidamente?

    
por prosseek 17.02.2010 / 19:06

2 respostas

4

Além de realmente abrir IDENT port 113 em direção ao cliente SSH (para que o servidor possa tentar se conectar a ele), você pode ter alguma sorte adicionando UseDNS no a sshd_config .

E eu duvido que isso ajude você (o cliente sabe onde encontrar o servidor, então não é o primeiro marcador, você tentou o segundo marcador, e os atrasos são maiores que 10 segundos, então os outros marcadores não se aplicam) , mas para os arquivos o FAQ do OpenSSH afirma:

ssh(1) takes a long time to connect or log in

Large delays (more that 10 seconds) are typically caused a problem with name resolution:

  • Some versions of glibc (notably glibc 2.1 shipped with Red Hat 6.1) can take a long time to resolve "IPv6 or IPv4" addresses from domain names. This can be worked around with by specifying AddressFamily inet option in ssh_config. [On the client; AvB.]
  • There may be a DNS lookup problem, either at the client or server. You can use the nslookup command to check this on both client and server by looking up the other end's name and IP address. In addition, on the server look up the name returned by the client's IP-name lookup. You can disable most of the server-side lookups by setting UseDNS no in sshd_config. [On the server, AvB.]

Delays less than 10 seconds can have other causes.

  • OpenSSH releases prior to 3.8 had an moduli file with moduli that were just smaller than what sshd would look for, and as a result, sshd would end up using moduli significantly larger than requested, which resulted in a speed penalty. Replacing the moduli file will resolve this (note that in most cases this file will not be replaced during an upgrade and must be replaced manually).
  • OpenSSH releases prior to 3.8 had a flaw in ssh that would cause it to request moduli larger than intended (which when combined with the above resulted in significant slowdowns). Upgrading the client to 3.8 or higher will resolve this issue.
  • If either the client or server lack a kernel-based random number device (eg Solaris < 9, AIX < 5.2, HP-UX < 11.11) and no substitute is available (eg prngd) it's possible that one of the programs called by ssh-rand-helper to generate entropy is hanging. This can be investigated by running it in debug mode:

    /usr/local/libexec/ssh-rand-helper -vvv

    Any significant delays should be investigated and rectified, or the corresponding commands should be removed from ssh_prng_cmds.

    
por 17.02.2010 / 21:19
1

Eu tenho experimentado lentidão no primeiro caso que você mencionou.

debug1: identity file /Users/smcho/.ssh/id_dsa type -1 <---

Minha versão do OpenSSH foi 5.1. Eu removi a instalação antiga e instalei o Cygwin OpenSSH 5.5, o issus de velocidade se foi. Talvez você possa tentar isso ...

    
por 04.07.2010 / 06:06