The Harbour Master is responsible for safety in a port. They make sure:
navigation marks are in position to assist ships navigate within the port.
Harbour Masters usually supervise the work of the harbour pilots making sure they provide a good service.
Harbour Masters make sure that ships using the port obey the port laws and other regulations. The Harbour Master can lay charges against people who break the port's laws and take them to court where they may be fined.