I use one of these
Master Locks or the same reason. I don't really need a lock, but I was after a receiver pin with square shoulders, not one of those bent J-pins that wears out the hols in the receiver tube. I had a similar problem with very tight clearance between the receiver and the 7-pin socket mount, but this works. I can hold the lock end between the side of the receiver and the socket, then insert the pin from the other end. I have easy access to the lock since it is at a right ange facing me.
It's fated as a hitch pin, I've been towing with it for years.