MD changed the license requirements a few years back. Used to be, there was none for coastal fishing, but now it's required, either from shore or boat in MD waters. The exceptions would be if you own land on the water, free fishing areas, or fishing with a licensed charter. For saltwater, if you don't need the license, you still have to register with the Saltwater Sportfishing Registry.
You can go to the MD DNR website & find all of this information there.
If you need to buy a saltwater license, you'll automatically be registered when you make your purchase.
MD does have temporary licenses, like a 7 day.
DNR Licensing and Registration Service - Maryland Department of Natural Resources