I could not ssh into my router after a firmware update. I tried to solve the problem from the post here. It did not work for me. The cause of my problem was different but the post was closed so I could not share. As well as having bash installed, I also had extroot and my root home folder set as
/home/root instead of
/root. As the
/home/root folder did not exist, I was getting the same error as not having bash installed. I hacked a router backup file to fix
/etc/passwd and then uploaded the archive to my router.
#on host machine mkdir sshfixed cd sshfixed cp $HOME/Downloads/backup-openwrt.tar.gz . tar -xf backup-openwrt.tar.gz rm -rf "$(find * | grep 'etc/' | grep -v 'etc/passwd')" sed -i 's#/home/root#/root#' etc/passwd sed -i 's#/bin/bash#/bin/ash#' etc/passwd tar -czvf sshfixed.tar.gz etc cp sshfixed.tar.gz $HOME/Downloads/
File can be downloaded here.