I've left Morocco twice through Tangier Med port and both times they've tried to hustle / scam me.
BLUF: There is NO ONE at the port that you need to give money to.
Here's how it goes down and how to avoid it.
When you arrive at the port the first stop (before immigration, etc...) is to confirm your booking (get a boarding pass). There's a big mostly empty parking lot in front of the various ferry companies offices. There will be a bunch of young punks standing around the parking lot trying to guide you in to a spot. Ignore them and park wherever you want.
As you walk to the ferry company offices in front of you (on the left hand side under a large covered area) they will follow you, trying to guide you to the right office, and maybe saying that they are officials working for the company. They may even display some company branded clothes (hats, neck lanyards, etc...). You don't need their help, there's only 6-ish small shacks and they are all well labeled with the ferry company names. Don't be surprised if the punks follow you even if you ignore them.
Give your passport and ticket to the company employee behind the shack window. He'll do some minor stuff with it and print out a boarding pass. Usually at this point instead of passing it back through the window he exits the shack through a side door. Then he'll give back your passport and boarding pass and ask for a confirmation/processing fee (10 Euro seems standard). Ignore him, take your stuff, and walk away back to your vehicle.
The little 'helper' thief will still be following you. Ignore him. He will talk and talk and talk about how you should pay him (10 Euro) for his "help". He will try to engage you in conversation to keep you there. Ignore him, get in/on your vehicle and drive away.
The next stop is the police immigration about 50 meters ahead and everything is fine from there on out.
These guys may seem intimidating but they will not hurt you. They are just pests. Ignore them and keep moving.
I can tolerate the hustle from the young parking lot nogoods but not from the adult company employee. So last time through I took his picture will my cell phone, told him he was a small thief, and walked away. Then I mailed the pic to the ferry company with an explanation of the behavior and that I wouldn't be using their company anymore (Inter Shipping -
www.intershipping.es). Maybe if enough people do the same the situation will improve.
These guys are sure reaching for the stars on what they expect from travelers who should already be streetwise on their way OUT of Morocco. 10 EURO?! Anywhere else in Morocco they would work 5x harder for a 2 Euro hustle!
Also it's worthwhile searching for "Morocco scams" before your trip to help you avoid the most common situations.