NSLU2: Using sftp-server with bash as shell

I’ve installed the bash shell on my Linksys NSLU2, and replaced the root’s shell with bash by editing the /etc/passwd file.

It worked fine, until I noticed that scp’ing to the NSLU2 didn’t work anymore… Reverting back to the sh shell, scp started to work again… The error was right after startup of scp it replied with “Connection closed”. No info on logs, what so ever.

I’m running SlugOS, and according to this thread: http://tech.groups.yahoo.com/group/nslu2-general/message/6537 it looked like a bash version bug.

Indeed I did have version 3.2-r2 installed… and so it would not work.

Because I have the optware repository enabled ( http://www.nslu2-linux.org/wiki/Optware/Slugosbe) I’ve checked that the bash version on this repository was newer. So:

– ipkg remove bash

– ipkg-opt install bash

– cp /opt/bin/bash /bin/bash

And while mantaining an open session, changed the shell to bash on one user and tried to logon. It worked.

And scp? It worked also, so with my finger’s crossed, I’ve changed again the root shell to bash, and logon on a new session. No problem. Indeed scp worked right away also.

So if any problems with scp failing, just upgrade your bash version.

Key words: sftp-server bash connection closed failed error 0