Thermal electrons cannot directly participate in the process of diffusive acceleration at electron–ion shocks because their Larmor radii are smaller than the shock transition width: this is the well-known electron injection problem of diffusive shock acceleration. Instead, an efficient pre-acceleration process must exist that scatters electrons off of electromagnetic fluctuations on scales much shorter than the ion gyroradius. The recently found intermediate-scale instability provides a natural way to produce such fluctuations in parallel shocks. The instability drives comoving (with the upstream plasma) ion–cyclotron waves at the shock front and only operates when the drift speed is smaller than half of the electron Alfvén speed. Here we perform particle-in-cell simulations with the SHARP code to study the impact of this instability on electron acceleration at parallel nonrelativistic, electron–ion shocks. To this end, we compare a shock simulation in which the intermediate-scale instability is expected to grow to simulations where it is suppressed. In particular, the simulation with an Alfvénic Mach number large enough to quench the intermediate instability shows a great reduction (by two orders of magnitude) of the electron acceleration efficiency. Moreover, the simulation with a reduced ion-to-electron mass ratio (where the intermediate instability is also suppressed) not only artificially precludes electron acceleration but also results in erroneous electron and ion heating in the downstream and shock transition regions. This finding opens up a promising route for a plasma physical understanding of diffusive shock acceleration of electrons, which necessarily requires realistic mass ratios in simulations of collisionless electron–ion shocks.