There are no clear cut answers on this issue. It can be exceedingly complex. In theory if you have multiple units in screened enclosures, and use metal connectors which take the shield (360 degree coverage) from the cable braid to the metal enclosure, then that is the best you can do. However, power supplies in the units are then likely to be grounded to the metal enclosure for safety reasons if derived from the mains, so earth loops exist. Many enclosures these days are insulated (plastic). Combinations of resistors as has been suggested, common mode chokes, differential amplifiers and drivers, transformer or optical isolation, isolated power supplies (batteries can be good) and more may have to be used. There are whole books written on just this topic, since it is related to EMC control. Solutions may have to be dealt with on a case by case basis, particularly when you may have no control of what may be plugged into a system that you have designed.
Cheers,
Richard