LinuxForum.Fans
Тема

Подключении по ssh

Автор: pmn3 20 сообщений 3629 просмотров
#331914

Уважаемые форумчане, здравствуйте.
Возникла у меня проблема при подключении по ssh, после ввода пароля соединение сразу же закрывается.

text
Connection to 10.10.10.10 closed by remote host.
Connection to 10.10.10.10 closed.

Host.allow и host.deny пустые.
Может кто-то встречался с такой проблемой?

#331917

Добавьте к команде опцию -v и покажите вывод консоли.

#331918
text
[root@localhost log]# ssh 10.10.10.10 -v -l user
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x009060df
debug1: Reading configuration data /etc/openssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: Connecting to 10.10.10.10 [10.10.10.10] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p2
debug1: match: OpenSSH_3.6.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client blowfish-cbc hmac-md5 none
debug1: kex: client->server blowfish-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.10.10.10' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
user@10.10.10.10's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: channel 0: request pty-req
debug1: channel 0: request shell
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: channel_free: channel 0: client-session, nchannels 1
Connection to 10.10.10.10 closed by remote host.
Connection to 10.10.10.10 closed.
debug1: Transferred: stdin 0, stdout 0, stderr 85 bytes in 0.3 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 309.3
debug1: Exit status -1
#331919

Файл с удалённого хоста /etc/ssh/sshd_config покажите.

#331922

В том то и дело что я туда подключиться то не могу. Доступа кроме как по ssh туда нет и ssh сейчас не работает.

#331924

А раньше подключение работало?

#331926

Да, раньше работало месяца 3 назад работало точно.

#331927

А scp работает?

#331928

Покажите ещё вывод команды, но с -vv.

"pmn3⇓" написал:
Да, раньше работало месяца 3 назад работало точно.

P.S. Админ удалённого хоста не имеет причин запретить вам подключение?

#331960

Вывод ssh -vv

text

OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x009060df
debug1: Reading configuration data /etc/openssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug2: ssh_connect: needpriv 0
debug1: Connecting to 10.10.10.10 [10.10.10.10] port 22.
debug1: Connection established.
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.6.1p2
debug1: match: OpenSSH_3.6.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.6.1p2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: blowfish-cbc,aes128-cbc,3des-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client blowfish-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server blowfish-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 121/256
debug2: bits set: 1594/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '10.10.10.10' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:4
debug2: bits set: 1643/3191
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
user@10.10.10.10's password:
debug2: we sent a password packet, wait for reply
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Entering interactive session.
debug2: callback start
debug2: ssh_session2_setup: id 0
debug1: channel 0: request pty-req
debug1: channel 0: request shell
debug2: callback done
debug1: channel 0: open confirm rwindow 0 rmax 32768
debug1: channel_free: channel 0: client-session, nchannels 1
Connection to 10.10.10.10 closed by remote host.
Connection to 10.10.10.10 closed.
debug1: Transferred: stdin 0, stdout 0, stderr 85 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 355.2
debug1: Exit status -1

Админ, настройки никакие не изменял я у него уточнял



Пользуйтесь тегами при оформлении сообщений.
verg

#332349

Удалось зайти на веб-интерфейс сервера, там в логах есть такие записи:

Aug 12 21:58:07 pam_tcb[22802]: sshd: Authentication failed for user from (uid=0)
Aug 12 21:58:11 pam_tcb[22802]: sshd: Authentication passed for user from (uid=0)
Aug 12 21:58:12 sshd[22809]: fatal: login_get_lastlog: Cannot find account for uid 502

#332350

Предположу...

"pmn3⇓" написал:
Aug 12 21:58:07 pam_tcb[22802]: sshd: Authentication failed for user from (uid=0)

Доступ root запрещён.

"pmn3⇓" написал:
Aug 12 21:58:12 sshd[22809]: fatal: login_get_lastlog: Cannot find account for uid 502

У пользователя изменился uid. (Соответственно, нет доступа к своему домашнему каталогу.)

#380167

Помогите открыть доступ по ssh. Сделал все что было описано по ссылке выше, кроме настроек iptables т.к. система у меня только установлена (RHEL 6.5) и iptables в ней по моему нет. По крайней мере через rpm -qa | less я iptables не нашел. Так как у меня устанволена графиечская оболочка зашел в настройки файерволла проверить доверяемые приложения, но ssh там уже отмечено как доверенное приложение. В /etc/hosts.allow добавил 192.168.1.0/255.255.255.0.

Что еще нужно сделать?

P.S. От машин в сети пинг до линукс машины есть.

#380183

Покажите подробный вывод команды при подключении, т.е.

text

ssh -v USER@HOST

или даже

text

ssh -vv USER@HOST
#380251

Я наверно не совсем правильно понимаю. Это нужно запустить на Линукс машине? Потому что с виндовой я через PuTTY пытаюсь подключиться.

#380254
"4kusnik" написал:
Это нужно запустить на Линукс машине? Потому что с виндовой я через PuTTY пытаюсь подключиться.

«Это» нужно ввести на машине-клиенте, в вашем случае — на компьютере с PuTTY.
P.S. Я не знаю, как происходит соединение через PuTTY, но, думаю, подробный вывод подключения и там можно увидеть.

#380268
Lupo Alberto написал:

«Это» нужно ввести на машине-клиенте, в вашем случае — на компьютере с PuTTY.
P.S. Я не знаю, как происходит соединение через PuTTY, но, думаю, подробный вывод подключения и там можно увидеть.

В PuTTY только адрес вводится. Ввести учетку под которой нужно войти там нельзя.

#380294
"4kusnik" написал:
В PuTTY только адрес вводится. Ввести учетку под которой нужно войти там нельзя.

Вы тут не правы, таки можно указать имя пользователя в поле адреса, отделив его от адреса символом "@". Например, "vpupkin@10.0.0.1" или "vpupkin@vpupkin.com". В этом случае putty при начале сеанса выдаст сообщение "Using username 'vpupkin'", а затем запросит пароль для указанного пользователя.

#380346

Переустановил дистрибутив. Все заработало. *HI*

#380362
4kusnik написал:
Переустановил дистрибутив. Все заработало. *HI*

*SCRATCH* ну это не по джэдайски :D
Лучше бы разобрались :P

Войдите или зарегистрируйтесь, чтобы ответить.