Archived Forum Post

Index of archived forum posts

Question:

How to connect SFTP using port other than 22 in c#

Jan 25 '17 at 09:34

I need to connect the SFTP with port other than 22. I have connected using the SFTP.connect(hostname,Port) method in c#, i am getting a error of

Username: HOMEWORKLP:Suresh_2 Architecture: Little Endian; 32-bit Language: .NET 4.5 VerboseLogging: 0 SftpVersion: 0 hostname: sftptest.ui.gov port: 8604 Established TCP/IP connection with SSH server clientIdentifier: SSH-2.0-PuTTY_Release_0.63 Sending client identifier... Done sending client identifier. Reading server version... initialDataFromSshServer: SSH-2.0-CrushFTPSSHD

serverVersion: SSH-2.0-CrushFTPSSHD
KeyExchangeAlgs:
  algorithm: diffie-hellman-group14-sha1
  algorithm: diffie-hellman-group-exchange-sha1
  algorithm: diffie-hellman-group-exchange-sha256
--KeyExchangeAlgs
HostKeyAlgs:
  algorithm: ssh-dss
  algorithm: ssh-rsa
--HostKeyAlgs
EncCS:
  algorithm: aes128-ctr
  algorithm: aes128-cbc
  algorithm: 3des-cbc
  algorithm: blowfish-cbc
  algorithm: arcfour128
  algorithm: arcfour
--EncCS
EncSC:
  algorithm: aes128-ctr
  algorithm: aes128-cbc
  algorithm: 3des-cbc
  algorithm: blowfish-cbc
  algorithm: arcfour128
  algorithm: arcfour
--EncSC
MacCS:
  algorithm: hmac-md5
  algorithm: hmac-sha1
  algorithm: hmac-md5-96
  algorithm: hmac-sha1-96
  algorithm: hmac-sha256
  algorithm: hmac-sha2-256
  algorithm: hmac-sha256@ssh.com
--MacCS
MacSC:
  algorithm: hmac-md5
  algorithm: hmac-sha1
  algorithm: hmac-md5-96
  algorithm: hmac-sha1-96
  algorithm: hmac-sha256
  algorithm: hmac-sha2-256
  algorithm: hmac-sha256@ssh.com
--MacSC
CompCS:
  algorithm: none
  algorithm: zlib
--CompCS
CompSC:
  algorithm: none
  algorithm: zlib
--CompSC
ChosenIncomingEncryption: aes128-ctr
ChosenOutgoingEncryptoin: aes128-ctr
ChosenIncomingMac: hmac-sha2-256
ChosenOutgoingMac: hmac-sha2-256
ChosenIncomingCompression: zlib
ChosenOutgoingCompression: zlib
ChosenKexAlgorithm: diffie-hellman-group-exchange-sha256
ChosenHostKeyAlgorithm: ssh-dsa
numBits: 128
pbits: 1024
Using GEX Group.
Sending KEX_DH_GEX_REQUEST...
pbits: 1024
Received GEX Group.
dhInitMsgType: 32
Sent e to server.
Using SHA256 for Exchange Hash
DSS host key parsed successfully.
dsaSigValid: 0
dss_key: 0000 0007 7373 682D 6473 7300 0001 0100

8F79 35D9 B9AA E9BF ABED 887A CF49 51B6 F32E C59E 3BAF 3718 E8EA C496 1F3E FD36 06E7 4351 A9C4 1833 39B8 09E7 C2AE 1C53 9BA7 475B 85D0 11AD B8B4 7987 7549 8469 5CAC 0E8F 14B3 3608 28A2 2FFA 2711 0A3D 62A9 9345 3409 A0FE 696C 4658 F84B DD20 819C 3709 A010 57B1 95AD CD00 233D BA54 84B6 291F 9D64 8EF8 8344 8677 979C EC04 B434 A6AC 2E75 E998 5DE2 3DB0 292F C111 8C9F FA9D 8181 E733 8DB7 92B7 30D7 B9E3 4959 2F68 0998 7215 3915 EA3D 6B8B 4653 C633 458F 803B 32A4 C2E0 F272 9025 6E4E 3F8A 3B08 38A1 C450 E4E1 8C1A 29A3 7DDF 5EA1 43DE 4B66 FF04 903E D5CF 1623 E158 D487 C608 E97F 211C D81D CA23 CB6E 3807 65F8 22E3 42BE 484C 0576 3939 601C D667 0000 001D 00BA F696 A685 78F7 DFDE E7FA 67C9 77C7 85EF 32B2 33BA E580 C0BC D569 5D00 0001 0016 A65C 5820 4850 704E 7502 A397 5704 0D34 DA3A 3478 C154 D4E4 A5C0 2D24 2EE0 4F96 E61E 4BD0 904A BDAC 8F37 EEB1 E09F 3182 D23C 9043 CB64 2F88 0041 60ED F9CA 09B3 2076 A79C 32A6 27F2 473E 9187 9BA2 C4E7 44BD 2081 544C B55B 802C 368D 1FA8 3ED4 89E9 4E0F A068 8E32 428A 5C78 C478 C68D 0527 B71C 9A3A BB0B 0BE1 2C44 6896 39E7 D3CE 74DB 101A 65AA 2B87 F64C 6826 DB3E C72F 4B55 9983 4BB4 EDB0 2F7C 90E9 A496 D3A5 5D53 5BEB FC45 D4F6 19F6 3F3D EDBB 8739 25C2 F224 E077 3129 6DA8 87EC 1E47 48F8 7EFB 5FDE B754 8431 6B22 32DE E553 DDAF 0211 2B0D 1F02 DA30 9732 24FE 27AE DA8B 9D4B 2922 D9BA 8BE3 9ED9 E103 A63C 5281 0BC6 88B7 E2ED 4316 E1EF 17DB DE00 0001 0100 8551 CAD6 A143 8139 50BA E3B0 AB66 A3D1 A447 D64F E880 74F0 B304 77F9 1033 E70C A28E 830B 444A BCA4 3BB5 7EC4 B7EE C34B 9036 B992 C867 7513 F068 09BB 200B BEF2 EAF1 86A4 9C4E 500C FD64 8158 9161 96FA F072 9D7C E10E C3E2 DAA6 2C41 4807 76E6 B7DF 3D74 0985 EF9E ADA0 7E45 FF2B 7874 5023 AC58 B6C6 2587 DEA1 ABC6 5E6D C339 88D0 124F 59AE 0DEE 45BF 410E 3F24 0200 D16D 1504 9A48 9B36 DFDF 239F FFD1 0FD2 8A17 33FA 7746 5463 082A B3C9 4CDD 4CC7 327A C97E 35B0 07A9 E763 2ECE 0E90 A0A1 7CB5 A328 8993 8952 94A5 A1E0 5996 F9F2 5A21 7FA9 A17E 7553 C124 553F A09F 66BD 2493 AAA1 8F2C 88DD CAF8 BAE6 02DA DB9B 3CCA AEAB CE4B 986D ABF5 0BCE D305 D288 sigH: 0000 0007 7373 682D 6473 7300 0000 389A 129C 6C33 F6FB E78B 4387 C08A 7CE9 5A11 A4C9 C6C5 62C1 480B 1983 300B 39B2 DECE 3375 C82D 9106 1B74 AEF8 876F 6CB5 9F63 3D71 9622 ADB3 DA exchangeHash: 88B3 A984 CAD4 2964 39C6 C40D F4E4 833A AF8E D9E7 900F CA9B 13C9 577C 753E CEFC

can you help us to connect the site.

Thank you in advance.


Answer

If the function to connect is SFTP.connect(hostname,Port) then just pass the port number in the 2nd argument.