I agree with many previous posters. Once compromised, one cannot truly determine if a computer has been scrubbed of the infection unless one takes known good media (CD, DVD, or whatever) and reinstalls everything, including retaining no data whatsoever (which includes making ALL brand new filesystems). It's a somewhat advanced topic, but everything in the boot path has to be rewritten, such as the MBR and anything it accesses.
Unless as leibold
suggests you want to retain the original disks for forensics, the easiest, prepackaged way I know of to do this is to boot up Darik's Boot And Nuke (DBAN). You will be left with absolutely squeaky clean hard disks. For your application, single pass mode will do as you're not likely at all to be doing data recovery. (Plus I've read that with most modern HDDs, multipass doesn't gain you anything, and if you really want industrial espionage/NSA grade unreadability of the platters, physical destruction is the only way.)
Really, seriously...you don't have to be playing around with octal. It's far easier just to think symbolically with
ugoa+-=rwx. (Readers' Digest version: u is user, g is group, o is other, a is all, + is add bits, - is take away bits, = is make it exactly this. There are also more arcane bits available, like t and s.
man -s 1 chmod for all the details.) So for example
chmod a= /tmp/test would be the symbolic equivalent of what you tried. Similar useful constructs would be:
- chmod a+rx myshellscript
- chmod u=rwx,go=rx ashellscript
- chmod go-w FileToRemoveGroupAndOtherWritability
- chmod o= FileWhereOtherHasNoRights