I did some testing tonight on a Windows computer connecting to a BSD server. If I enter
putty.exe -l username -pw password server.domain.com
I get connected without a problem. If I try
putty.exe -l username -P password server.domain.com
I get an alert box opening with a title of PuTTY Internal Error
and a message of Invalid Port Number
. In fact, that's the only time I can get that error message.
If you are using a good password (mixed case, special symbols, etc) the password may be the source of the problem. Maybe try enclosing the password in double quotes, as in
putty.exe -l username -pw "password" server.domain.com
Are you using the latest version of PuTTY? I'm using 0.60, which appears to be the most recent version.
Finally, and I know these sound really simple, are you manually entering this on a command prompt while you are testing, or is your testing being done as part of a larger script? For simplicity's sake, I would get it working manually before trying to integrate it into a larger process. For the same reason, I would also leave off trying to automatically run the remote command (-m
) while trying to figure out this issue. It looks like you already are, but it never hurts to check ...
If you can't tell, I'm kind of grasping at straws here. I can't seem to replicate the problem except when there is a -P
included somewhere on the command line.