Autor Tópico: SSH faz conexão externa, mas não consigo fazer login  (Lida 2508 vezes)

Offline celomorais

  • Usuário Ubuntu
  • *
  • Mensagens: 8
    • Ver perfil
SSH faz conexão externa, mas não consigo fazer login
« Online: 03 de Novembro de 2010, 08:40 »
Olá Galera, estou aqui pra postar uma duvida... tou querendo me conectar com o computador atraves do do ssh, ja fiz o nat no modem, já adicionei as regras no iptables, ja instalei o no-ip direcionando o dns para a minha maquina e não consigo me conectar o ssh usando o login do no-ip, instalei o nmap e cuja saida é essa:

celo@ubuntu:/home/celo# nmap celomorais.no-ip.info

Starting Nmap 5.21 ( http://nmap.org ) at 2010-11-01 15:04 BRT
Nmap scan report for celomorais.no-ip.info (187.58.178.125)
Host is up (0.0042s latency).
rDNS record for 187.58.178.125: 187.58.178.125.static.host.gvt.net.br
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
8085/tcp open unknown

e rodei o comando ssh -vv celo@celomorais.no-ip.info

OpenSSH_5.5p1 Debian-4ubuntu4, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to celomorais.no-ip.info [187.58.178.125] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu4
debug1: match: OpenSSH_5.5p1 Debian-4ubuntu4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu4
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 187.58.178.125

visto que há conexão estabelecida mas nao consigo fazer o login, pesquisando mais um pouco na internet executei esse comando /usr/sbin/sshd -d que me retornou essa saida:


(usa Debian) [5] Enviado em 02/11/2010 - 02:59h:


Ao rodar o comando aparece isso aqui:

root@ubuntu:/home/celo# /usr/sbin/sshd -d
debug1: sshd version OpenSSH_5.5p1 Debian-4ubuntu4
debug1: read PEM private key done: type RSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: private host key: #0 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: Checking blacklist file /usr/share/ssh/blacklist.DSA-1024
debug1: Checking blacklist file /etc/ssh/blacklist.DSA-1024
debug1: private host key: #1 type 2 DSA
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
Set /proc/self/oom_adj from 0 to -17
debug1: Bind to port 22 on 0.0.0.0.
Bind to port 22 on 0.0.0.0 failed: Address already in use.
debug1: Bind to port 22 on ::.
Bind to port 22 on :: failed: Address already in use.
Cannot bind any address.

Dai parei por aqui e nao sei mais o que fazer =/

Offline zekkerj

  • Usuário Ubuntu
  • *
  • Mensagens: 19.735
  • Gratidão gera gratidão, lamúria atrai lamúria...
    • Ver perfil
    • Blog do Zekke
Re: SSH faz conexão externa, mas não consigo fazer login
« Resposta #1 Online: 03 de Novembro de 2010, 10:08 »
Citar
Bind to port 22 on 0.0.0.0 failed: Address already in use.
debug1: Bind to port 22 on ::.
Bind to port 22 on :: failed: Address already in use.
Cannot bind any address.
Você tem que parar o serviço ssh antes de iniciar um novo processo:

sudo service ssh stop

Sobre o problema inicial (dificuldade pra conectar), você está testando a partir da rede interna? Nem sempre isso dá certo.

P.ex., na saída do nmap, há uma segunda porta aberta (8085). Vc lembra de ter aberto essa porta?
Pesquise antes de perguntar, sua dúvida pode já ter sido respondida.
Não respondo dúvidas por MP, coloque sua dúvida no fórum onde ela pode ser pesquisada pelos seus colegas!
Não venha ao fórum apenas para perguntar. Se você sabe a resposta de um problema, porque não ajudar seu colega? ;D