I have had many students from all over the world and am still slightly irritated when e.g. an American doesn't offer her hand when we meet. Probably you can't go wrong offering a German a firm handshake. It is never seen as offensive. There might be people rejecting this offer of yours, but that usually indicates some health- or psychological issues.
Also make sure that you apply the right pressure. If you take the other hand too softly, you might come over as very weak and timid. If you squeeze my hand to dust, well... you get the idea.
It doesn't matter whether you greet a man or a woman.