Community discussions

MikroTik App
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

ROS 5.4 SSH closes SSH connection immediately?!?

Wed Jul 13, 2011 12:51 pm

There is RouterOS 5.4 on RB750G.
Winbox connection is established normally, but all ssh attempts are closed immediately after password validation:
ssh -p244 admin@10.10.10.3
admin@10.10.10.3's password:  <<WrongPassword>>
Permission denied, please try again.
admin@10.10.10.3's password:   <<ValidPassword>>
Connection to 10.10.10.3 closed by remote host.
Connection to 10.10.10.3 closed.
SSH service is listening on port 244, /ip ssh set forwarding-enabled=yes.
No IP protection, no firewall.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: ROS 5.4 SSH closes SSH connection immediately?!?

Wed Jul 13, 2011 4:13 pm

check if you have set public key for that user you are trying to authenticate with. Most probably, you do, and since 5.0rc2 it is not allowed to used password authentication if key is set, you have to use private key to authenticate.
 
User avatar
petrn
Member Candidate
Member Candidate
Posts: 180
Joined: Thu Jul 29, 2010 3:56 am
Location: Dubai

Re: ROS 5.4 SSH closes SSH connection immediately?!?

Wed Jul 13, 2011 4:58 pm

check if you have set public key for that user you are trying to authenticate with. Most probably, you do, and since 5.0rc2 it is not allowed to used password authentication if key is set, you have to use private key to authenticate.
Short message "Password authentication not allowed" will stop lot of question in forums, along with proper wiki page.
 
SpaceCommander
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 50
Joined: Fri Dec 26, 2008 3:35 am

Re: ROS 5.4 SSH closes SSH connection immediately?!?

Thu Jul 14, 2011 6:14 am

check if you have set public key for that user you are trying to authenticate with.
Most probably, you do, and since 5.0rc2 it is not allowed to used password authentication if key is set,
you have to use private key to authenticate.
"/user ssh-keys print" on RouterBox is empty.
$HOME/.ssh on workstation contains no keys.

The problem still actual... :(

This is "ssh -v ..." output:
OpenSSH_5.1p1 Debian-3ubuntu1, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /home/scom/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [10.10.10.3] port 22.
debug1: Connection established.
debug1: identity file /home/scom/.ssh/identity type -1
debug1: identity file /home/scom/.ssh/id_rsa type -1
debug1: identity file /home/scom/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version ROSSSH
debug1: no match: ROSSSH
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-3ubuntu1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) 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.3]:22' is known and matches the DSA host key.
debug1: Found key in /home/scom/.ssh/known_hosts:51
debug1: ssh_dss_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: /home/scom/.ssh/identity
debug1: Trying private key: /home/scom/.ssh/id_rsa
debug1: Trying private key: /home/scom/.ssh/id_dsa
debug1: Next authentication method: password

admin@10.10.10.3's password: 
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = ru_RU.UTF-8
debug1: Received SSH2_MSG_UNIMPLEMENTED for 8
debug1: channel 0: free: client-session, nchannels 1
Connection to 10.10.10.3 closed by remote host.
Connection to 10.10.10.3 closed.
Transferred: sent 1680, received 1312 bytes, in 0.2 seconds
Bytes per second: sent 11050.7, received 8630.0
debug1: Exit status -1
 
falz
Frequent Visitor
Frequent Visitor
Posts: 56
Joined: Tue Jun 03, 2008 10:54 pm

Re: ROS 5.4 SSH closes SSH connection immediately?!?

Mon Aug 15, 2011 2:19 am

I'm having the same issue, I posted a thread here with details before I saw this one:

* http://forum.mikrotik.com/viewtopic.php?f=2&t=54223

We appear to be running the same OpenSSH version, although it's on a different platform. I'll test a different version and see if the issue persists.

Edit: Found the fix. It's a bug with the implimentation of Mikrotik's SSH daemon in combination of an OpenSSH feature. OpenSSH added a workaround for it in v5.2, so upgrade or downgrade your client or wait to see if Mikrotik fixes it. More details in my thread above.

Who is online

Users browsing this forum: Google [Bot], TuxPowered and 54 guests