Very simple - the moment you scrap a ship and are forced out of the terminal, look at the terminal again and hold whatever button to re-enter the terminal and the ship you just scrapped will be available to scrap again.
Before doing this I recommend having maximum inventory spaces in your exosuit and completely emptying everything that isn't installed tech. You can re-scrap the same ship over and over until your inventory is full. You take the upgrade modules that you get from scrapping the ship and you sell them to the person you would've purchased them from. Sell everything else at the shopping terminal, rinse and repeat. In the last few days I've made around 200,000 Nanites and 1.5 billion units.
When you scrap S class ships you will get S class upgrade modules and you may actually want to keep or install some of those instead of selling them for Nanites.
Another little trick, if you save the game and reload you can go to the surface of a planet and call in a ship from your inventory called "The Aegis of the Void" or something and it will be the last ship that you scrapped. If you scrap an S-Class that gives you some upgrade modules that you really like you can simply save the game and reload and go down to the surface and call that ship back and scrap it again and get a stack of those upgrade modules again.