So I dug up Douglas P. Laus excellent NXT_Python module that does everything you need in terms of managing files on the brick, and then I added a shell on top. You can find it here: http://www.danbbs.dk/~kibria/nxt/nxtsh.py.
A couple of notes:
- You need the NXT_Python package, and you need the packages that NXT_Python requires. You can find these at Douglas' page.
- The pyusb link on Douglas' page seems broken - use the SourceForge page instead if you have problems
- This can as far as I can see only run as root when using USB due to a restriction in the pyusb module used by NXT_Python.