Escape a ! in the password parameter of wget
Try using quotes:
--password="bar\!"
or --password='bar\!'
What is the error on the server side?
Update:
I ran a test on my Ubuntu 10.4 machine running Apache 2.2.14. wget --user=foo --password=bar! url
works for me.
If I use the wrong password, I get an error like user foo: authentication failure for "/directorytest/": Password Mismatch
.
Update again: (Taking a step back)
You say this error is "client denied by server configuration". I browsed the Apache source, and this error message comes from mod_authz_host. This indicates that your problem is not with the password (Which is authentication) but your client host is not authorized to access this Apache resource. mod_authz_host deals with hostnames and IPs.
Above, you say "On the Windows command line, the command works." Are all of your tests coming from the same client system? Are you running 'wget' on this same Windows system? What happens if you try to access this same URL using IE or Firefox?
More discussion here and here.