You're going to have to open those gates yourself.
Of course, you'll need to get inside the city first.
That means you have to get the password to get inside.
A certain merchant will tell you if he thinks you deserve in.