What is suppose to happen is that after giving him some of Rimmer's ale (through a speech option), you can ask him something about the mine (don't recall if you mention the password specifically), and after convincing him that you are friends since you are drinking together, he tells you the password. Others have had problems getting him to talk, but fortunately the password is not necessary since the sentry is so easy to kill.