Como faço para que o servidor SSH funcione com o putty client?

2

Eu tenho um computador desktop Ubuntu 12.04.01 de 64 bits. Tem openssh-server instalado.

Quando eu SSH para o servidor de uma caixa Linux, ele funciona. Mas quando eu uso o PuTTY da minha Windows 7 PC para conectar, então eu só recebo um erro imediato:

The server closed the connection unexpectidely

O servidor e o PC estão na mesma LAN. Ambos têm IPs estáticos.

Eu pesquisei, mas não consegui descobrir por que o servidor OpenSSH fecha imediatamente a conexão. Não dá nem a opção de login.

Como posso encontrar e corrigir esse problema?

EDIT: conteúdo do arquivo sshd_config adicionado:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
IgnoreUserKnownHosts no
PasswordAuthentication yes
GatewayPorts yes
AllowTcpForwarding yes
KeepAlive yes
    
por Mazal 09.01.2013 / 09:40

2 respostas

1

Isso pode parecer um pouco óbvio, mas você precisa configurar o puTTY para ssh, ele pode fazer vários protocolos. Na categoria Sessão :

Hostname: <remote IP>
Connection Type: ssh
Port: <should default to 22>

Note que se você mudou a porta do padrão, você também deve especificá-la em sua conexão linux.

Em seguida, na categoria Conexão- > SSH , verifique se o SSH preferido está definido como "2" ou "2 apenas" (sua configuração mostra dois tipos de suporte e é melhor do que 1)

Finalmente o puTTY pode armazenar informações em seu próprio log, o que pode iluminar o problema, clique na categoria Session- > Logging para descobrir onde o arquivo está, defina o log como "All session output" e veja o que aparece.

O erro que você recebe mostra o servidor remoto não está estabelecendo uma conexão, o que significa:

  1. Você tem o IP errado
  2. Você tem a porta errada
  3. Há um firewall no servidor remoto impedindo conexões desta caixa
  4. Há uma configuração de SSH impedindo que seu host específico se conecte (como harish.venkat mencionou)
por Rudu 18.12.2013 / 16:38
0

No seu host remoto, instale o ssh aberto e o servidor openssh digitando

% bl0ck_qu0te%

Agora, verifique se o serviço foi iniciado e, caso contrário,

% bl0ck_qu0te%

Se a conexão ainda estiver sendo bloqueada, isso significa que você precisa adicionar a regra de firewall e reiniciar o firewall

% bl0ck_qu0te%

adicionará / habilitará a regra de firewall para ssh.

Certifique-se de verificar se o ssh está escutando na porta 22. Para confirmar o tipo

% bl0ck_qu0te%

Agora, experimente seu putty ou outro terminal para fazer ssh ssh user@server-ip

Espero que isso ajude. Boa sorte.

    
por rulebreaker4 21.12.2014 / 05:34