The method
sciencemonster describes is the time honoured way it has always been done, usually not even having a hole in the 2 x 2, just supporting the crank really close to the cotter. Shops have used special tools, most of which are no longer made. However, Mark Stonich makes a neat
cotter press that would be handy for someone who works a lot with old bikes.