It really depends on the type of lock:
1. The easiest locks are those Canadian locks with floating docks in them (Ottawa river, Chambly canal, Lachine canal). They even have attendants to help you dock.
2. Next are those with cables fixed at both ends (Erie canal, Rideau Canal) and those with floating bollards (the big rivers). In both of these one can quite easily control the boat from the helm window by looping a line around the cable or bollard. The bollards are sometimes quite high (when you are locking up) and big, so a boat hook is often needed to get the line around them. the lock keeper will usually tell you which bollard to use, but be sure to ask if he doesn't because they occasionally get stuck and you sure don't want to be on a stuck bollard when the water starts to move!
3. Next are the locks with hanging ropes (Erie canal) and those where ropes are thrown down or handed to you (some of the big river locks). The problem here when single handing is that you really need to be at the center (for and aft) of the boat to be able to control both ends, but since the bottom of the rope is not fixed, you loose a lot of purchase when the lock is empty if you are holding the rope through the helm window. The deeper the lock the worse this is. You can still do it, but you need BIG fenders at both ends to protect from those times when the boat pivots some before you can get it back straight.
4. Finally, if you are alone in a lock on the big rivers (particularly the Mississippi and Ohio), always ask if you can float in the middle of the lock. They will often let you do this, and it is usually not at all difficult to keep station as one is lifted or lowered.
5. All the above can, of course, be made much more difficult by the weather. Strong cross winds are best avoided when single handing. If you have to lock through in a cross wind, be mindful that the wind will swirl in the lock so that it will actually try to blow you off the down-wind wall when the lock is empty (and against it, of course, when the lock fills).
6. When single handing you will sooner or later get into a situation where the boat has pivoted 20 or 30 degrees (maybe more) before you have been able to control it. You need to protect the bow and stern of your boat with big fenders on each side of your boat, one as far aft as possible (especially if you have a swim step) and one, preferably one of the spherical variety, near the bow. You need a third fender on each side hanging amidship where your boat starts to curve in towards the bow.
7. Finally, tell the lock keeper ahead of time that you are single handing. If there are other boats locking through, consider asking one if you can raft with them since you then have three people helping with the tying up. Switch sides immediately if you are having problems on one side. And never be embarrassed by anything that happens; we will all have been there and done that even with crew to help!