SSH not working after upgrade to 18.06.0 (from 15.05)

Hi all. I have Archer C5 v1 (openwrt[dot]org/toh/tp-link/archer-c5-c7-wdr7500), I have been using 15.05 one and a half year or so. Yesterday I decided to upgrade to 18.06.0. I used sysupgrade method via ssh, all seemed to proceed fine, device rebooted, but after reboot, the SSH is not available. Router works as expected, configuration was successfully migrated, I can acces LUCI and verify, that new version is there, with firewall rules, dhcp configuration etc.

But SSH for some reason does not work. Dropbear is installed, configured and running:
Screenshot_2018-08-02_08-48-56.
Firewall does not block it, and I can communicate with it. When I telnet to it, I can see Dropbear banner, when I provide correct ssh key, dropbear auths me, and then close the connection:

ssh root@192.168.1.1 -p2222
Connection to 192.168.1.1 closed.

When I do not use key, and provide correct password:

ssh root@192.168.1.1 -p2222
root@192.168.1.1's password: 
Connection to 192.168.1.1 closed.

intentionaly wrong password

ssh root@192.168.1.1 -p2222
root@192.168.1.1's password: 
Permission denied, please try again.
root@192.168.1.1's password: 
Permission denied, please try again.
root@192.168.1.1's password: 
Connection to 192.168.1.1 closed by remote host.
Connection to 192.168.1.1 closed.

I tried to install openssh-server and connect to port 22, but connection is refused.

I suspected I might have done wrong thing by adding '/root/' into /etc/sysupgrade.conf before upgrade, so I removed it via LUCI, and then flashed syupgrade image again via LUCI. The situation remains exactly the same.

Can I please ask someone, do you have any pointers, how I should proceed now, so I can successfully use ssh?

Here is more verbose ssh connection, but does not tell me really anything useful.

Edit: I also tried uninstalling dropbear completely, and install it again. No progress.

15.05 is so old that there may be something going wrong in the settings migration.

One option is to reset the router, test ssh connectivity with the defaults, and if ok then create settings by hand from scratch.

Thank you, that is one option, that I have as a last resort :slight_smile:

Did you have another shell installed on 15.05 so that your migrated /etc/passwd points to a not installed /bin/bash ?

In such a case you could misuse the ‚ÄěLocal Startup‚Äú page of LuCI to fix it up

1 Like

On the same track, I think that also /etc/profile has been updated since 2015.
You might copy the current one from /rom/etc/profile to /etc/profile
(copying might work remotely with scp, but not sure if ssh is problematic in general)

Similarly, some other generic settings files have been changed since 2015, and you have likely sysupgraded the old versions into 18.06

That is actually good point, and I am not completely sure. I might have installed bash, if that was not in installation by default, do not remember tbh. I will recheck this afternoon, if bash is installed, there is very high chance, that root has /bin/bash as his shell.

@jow indeed it was it. After installing bash the login via SSH works as expected. Thanks for the idea, you saved me time.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.