Design of an intense but tightly focused ultrashort electron beam for production of sub-hundred femtosecond X-ray pulses that based on head-on inverse Compton scattering (ICS) has been studied. The three dimensional (3D) space charge dynamics has been tracked and optimized throughout the whole beamline. It is found that the focusing ultrashort electron pulses as short as 67 fs can be produced by compressing the energy-chirped beam from a thermionic cathode rf gun with an alpha magnet and linac operating at injection phase near zero crossing. This multi-bunch electron beam has an intensity of 30 pC per bunch and is accelerated to 27 MeV with an S-band linac structure. The compressed electron beam is focused to 64 μm for scattering with an 800 nm, 3.75 mJ laser in the laser-beam interaction chamber. With this method, total peak flux of back-scattered X-ray photons exceeds 1018 photons/sec is achievable with the shortest wavelength of 0.7 Å.