I'm actually running into a weird problem. I got this to work reliably with other use cases except for Perforce. For some reason I can't get it to recognize the password I'm sending. I tried sending it as a complete string using ShellStream.WriteLine, as well as one character at a time using ShellStream.Write. I even added some delay between each password character that is sent but still no luck.
I also captured a Putty session where it does accept the password, and tried to simulate the exact character sequence but still no luck.
Here is a Putty session of a successful login. I changed the password to "foo":
EDIT: Ignore the final \r\n as it is actually an incoming packet so is not relevant to the issue. I did try sending just a \r instead of \r\n but that didn't make a difference either.
Any ideas?
I also captured a Putty session where it does accept the password, and tried to simulate the exact character sequence but still no luck.
Here is a Putty session of a successful login. I changed the password to "foo":
Incoming packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 01 00 00 00 00 10 45 6e 74 65 72 20 70 61 ........Enter pa
00000010 73 73 77 6f 72 64 3a 20 ssword:
Outgoing packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 00 00 00 00 00 01 66 ........f
Incoming packet type 2 / 0x02 (SSH2_MSG_IGNORE)
00000000 00 00 00 05 db 7c eb 90 d4 .....|...
Outgoing packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 00 00 00 00 00 01 6f ........o
Incoming packet type 2 / 0x02 (SSH2_MSG_IGNORE)
00000000 00 00 00 05 45 19 e9 63 bf ....E..c.
Outgoing packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 00 00 00 00 00 01 6f ........o
Incoming packet type 2 / 0x02 (SSH2_MSG_IGNORE)
00000000 00 00 00 05 51 89 09 fa 51 ....Q...Q
Outgoing packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 00 00 00 00 00 01 0d .........
Incoming packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
00000000 00 00 01 00 00 00 00 02 0d 0a ..........
Incoming packet type 94 / 0x5e (SSH2_MSG_CHANNEL_DATA)
... Password accepted....
I did notice the single \r and then a \r\n sequence, but even simulating that sequence doesn't work as it keeps refusing the password.EDIT: Ignore the final \r\n as it is actually an incoming packet so is not relevant to the issue. I did try sending just a \r instead of \r\n but that didn't make a difference either.
Any ideas?