Hi craigh,
Well, I guess you learnt the hard way that you've got to be careful what you're doing when you're root, and
think before you type!
Anyway, if I didn't have anything special set up that I needed to save, I think I would do a fresh install too. Just to be sure. But if there is stuff that needs to be saved, then you could start by issuing
which would make everything readable, writable and executable by root, and readable and executable by everything else.
Then from there move onto specific folders, such as /etc in which pretty much every file has permissions of rw by root, and readable by everyone else
Code:
cd /etc
ls -l | grep -v ^d | cat > files.txt
would give you a list of all the actual files, and
not the directories as these need to have different permissions. You could then at least use this file as a reference to know what files you need to change the permissions on, and if you reissue the command every so often, you'll be able to see how far you've got. You should also be able to see the files that should have different permissions, such as shadow and passwd, which should have permissions of 600 (rw by root, nothing for anybody else).
I'm sure there's probably a better way of doing this, but I don't know what it is.
Cheers,
Steve