Say you want to disable the automounting feature of Ubuntu. You can press Alt+F2 and type polkit-gnome-authorization. Press Enter and in the new window that appears go to Storage > Mount file systems from removable drivers.
Press Edit.
Select Active Console: Authentication.
Press the Modify button.
Alternatively, if you only want to disable the Nautilus window that opens up every time you plug in a storage device, the simpler method for this is to open up Nautilus, go to Edit > Preferences > Media and turn off Browse media when inserted.