How can I access media on my OnePlus 5 with a Ubuntu OS?

What you want to do is to configure your phone's USB settings for MTP (Media Transfer Protocol). Unfortunately, this is hidden away deep in the Developer Settings on recent OnePlus 5 phones. To enable Developer Options, go to the phone's "About Phone" page (in the settings) and tap the build number 7 times.

Then, open the Developer Options (from System Settings), enable it, and look for the Default USB Configuration option. Change it from "Charging only" or "No data transfer" (probably the default) to "MTP"/"File transfer". Then, your phone should work like any other USB storage device.