I was able to find a reference to this in chapter 22 of The Complete Idiot's Guide to Household Solutions.
Though honestly, I've never heard of this approach until now. I'm no expert on the corrosiveness of salt, but I would imagine the levels of salt in the sewer would not be high enough to rust the pipe. I'm also skeptical that the salt levels would be high enough to completely kill and prevent the roots. While I wouldn't recommend pouring a bag for rock salt down the drain, a handful once or twice a month will probably not hurt the pipe.
There are other tried and true methods to remove roots from sewer lines.
Mechanincal
Augers
Augers can be used to effectively remove roots from a sewer line, by cutting the roots out. This is not likely a solution for a DIYer, since it involves expensive specialty tools. This method will not prevent roots from growing back into the sewer.
Hydrojetters
A hydrojetter is essentially a power washer with a rotating mechanical "sweeper", that is designed to be fed into the sewer line and blast and sweep roots away. Again, this is not likely a DIY option and does not prevent the roots from regrowing.
Digging
In some cases roots may have caused too much damage to the sewer line, and the only option available is to dig the line up and replace it. This can be very expensive, and will almost certainly not be a DIY project.
Chemical
Contact Herbicides
Contact herbicides are chemicals that will kill the roots, and in some cases prevent them from regrowing. These are typically a more DIY friendly option, and can be found as simple "pour down" solutions.
Contact herbicides can include:
A common product recommended by plumbers is RootX. This is a herbicide in a foaming carrying agent, that allows the herbicide to reach roots at the top of the pipe. RootX uses Dichlobenil, and is non-caustic, non-fumigating, and non-systemic. Unfortunately, it's not readily available to homeowners, so you'll likely have to contact a plumber for this treatment.
Searching around, I stumbled upon a product similar to RootX that is available to homeowners. Roebic® Foaming Root Killer is available at Lowes for about $20.00. It foams up, and uses dichlobenil as the herbicide just like RootX.
Make sure you check with your local municipality and environmental agencies, before pouring chemicals down your drain
Planning
One of the best ways to prevent roots from entering your sewer line, is to carefully plan where you plant trees and other deep rooting plants.
Best Answer
If the pipe itself is in good enough shape, you could just use a compression cleanout plug (sometimes called a mechanical cleanout plug) or a pressure testing plug:
There are quite a few different styles of these, but almost all of them work by compressing and expanding a rubber gasket inside the pipe. 2.5" might be hard to find at the big box stores, but they are available numerous places online. The main consideration would be finding one that would seat deep enough into the pipe that it would be beyond the notches for the old cap.