I made the stupid choice of change the root shell (/bin/sh) to the bash I installed with optware (/opt/bin/bash).
When I installed optware and several packages from it, I did what was stated on the guide for optware, and transfer all the binaries to /share/private folder, leaving a link (/opt) pointing to the private folder.
For some reason I can't figure out, the /share/private folder was deleted. That wasn't so bad if I didn't change the root shell to bash shell :(.
The problem is that now I am not able to ssh as root. ssh as admin is ok, but it turns out to be worthless, as it doesn't have permissions to change /etc/passwd, nor install the bash shell in the right path for user root work.
su or sudo doesn't exist in the system.
What I have in mind:
1. open the mbwe, take out the disk, connect to linux box, mount it and edit the /etc/passwd.
2. using some script like the MBWE-get-in-test, and force a "fake" upgrade to change the /etc/passwd during the reboot.
Where I need your help:
1. Is that procedure ok? I thing it is, but would prefer the second one… don't want to open the mbwe.
2. I can do the script to change /etc/passwd (example below), but I am ware of how I can put the script in the /var/upgrade folder. The examples I see in the net are not valid for my mbwe.
The MBWE-get-in-test states this http link:
In my mbwe the path is not valid. It doesn't have any firmware_upgrade.pl script, I guess.
I don't know what options I have.
I just detected it has:
No one will work, I guess.
Could I use the manual update ? selecting a file from my disk, with the script I want to run (see below) ?
Or that will brick the NAS server ?
script to change /etc/passwd:
echo '#!/bin/sh' >/var/upgrade/upgrade1.sh
chmod 755 /var/upgrade/upgrade1.sh
cp /etc/passwd /etc/passwd.backup
chmod 644 /etc/passwd.backup
sed 's/\/opt\/bin\/bash/\/bin\/sh/g' /etc/passwd.backup > /etc/passwd
rm -f /tmp/active_upgrade