During the study of resistive switching devices, researchers have found that the influence of the insertion layer cannot be ignored, and many reports have confirmed that the appropriate insertion layer can significantly improve the performance of the resistive switching devices. Therefore, in this paper, we used magnetron sputtering to fabricate three devices: Cu/MgO/Cu, Cu/MgO/MoS<sub>2</sub>/Cu and Cu/MoS<sub>2</sub>/MgO/Cu. Through the characterization test of the device and the measurement of the I-V curve, it is found that the resistive switching characteristics of the Cu/MgO/Cu device will change greatly after MoS<sub>2</sub> insertion layer is added. Analysis results show that MoS<sub>2</sub> inserted layer didn't change device of the main transmission mechanism (space charge limited conduction), but the impact the regulating function of interfacial potential barrier, the effect also is associated with the location of MoS<sub>2</sub> inserted into the layer. Among the Cu/MgO/Cu, Cu/MgO/MoS<sub>2</sub>/Cu and Cu/MoS<sub>2</sub>/MgO/Cu devices, the Cu/MgO/MoS<sub>2</sub>/Cu device exhibits a larger switching ratio (about 10<sup>3</sup>) and a lower reset voltage (about 0.21 V), which can be attributed to the regulation of the interface barrier between MgO and MoS<sub>2</sub>. In addition, when the MoS<sub>2</sub> layer is inserted between the bottom electrodes Cu and MgO, the leakage current of the device is significantly reduced. Therefore, Cu/MoS<sub>2</sub>/MgO/Cu devices have the highest commercial value from the point of view of practical applications. Finally, combined with XPS results and XRD results, we give the conductive filament models of the three devices, and analyze the reasons for the different resistive switching characteristics of the three devices.