Mayor Michael Bloomberg says a retired New Jersey locksmith has agreed to stop selling New York City master keys online.

Yamada Taro, Getty Images

Bloomberg said Monday city officials spoke to Daniel Ferraris. He's agreed to stop selling the keys on eBay.

An undercover New York Post reporter bought a five-key ring last week. Ferraris told the newspaper he'd bought the keys from collectors.

One key opened phased-out fire alarm boxes. One may be a key that firefighters use for elevators. The other keys may belong to electricians, or other construction workers who have access to city sites.

He didn't return several calls seeking comment Monday.

Bloomberg says there's no way to totally prevent the keys from changing hands -- but they'll try.

(Copyright 2012 by The Associated Press.  All Rights Reserved.)