Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all 3858 articles
Browse latest View live

Openload.co Ftp Server and MLSD

$
0
0

Hi.
I am having trouble connecting to the Openload.co cloud server via FTP.
When the FEAT command is sent, the server sends an MLSD response.
However, Rebex sends a LIST command when the list is requested.
The server supports MLSD, and Rebex does not recognize MLSD support for any reason.
If I look into the 'SupportedExtensions' variable after the FTP connection, only UTF-8 will appear.
PS. I sent FEAT command again for check.

Thank you.

2019-03-07 15:55:34.355 Opening log file.
2019-03-07 15:55:34.358 INFO FileLogWriter(1)[6] Info: Assembly: Rebex.Common 2018 R4 for .NET 4.0-4.7
2019-03-07 15:55:34.360 INFO FileLogWriter(1)[6] Info: Platform: Windows 10.0.17134 64-bit; CLR: 4.0.30319.42000
2019-03-07 15:55:34.361 DEBUG FileLogWriter(1)[6] Info: Culture: en; ks_c_5601-1987
2019-03-07 15:55:34.376 INFO RaiFtp(1)[6] Info: Connecting to ftp.openload.co:21 using Ftp.
2019-03-07 15:55:34.376 INFO RaiFtp(1)[6] Info: Assembly: Rebex.Ftp 2018 R4 for .NET 4.0-4.7
2019-03-07 15:55:34.376 INFO RaiFtp(1)[6] Info: Platform: Windows 10.0.17134 64-bit; CLR: 4.0.30319.42000
2019-03-07 15:55:34.376 DEBUG RaiFtp(1)[6] Info: Culture: en; ks_c_5601-1987
2019-03-07 15:55:34.377 INFO RaiFtp(1)[6] Info: Using proxy none.
2019-03-07 15:55:34.393 DEBUG RaiFtp(1)[6] Proxy: Resolving 'ftp.openload.co'.
2019-03-07 15:55:34.405 DEBUG RaiFtp(1)[6] Proxy: Connecting to 185.163.108.45:21 (no proxy).
2019-03-07 15:55:34.732 DEBUG RaiFtp(1)[6] Info: Connection succeeded.
2019-03-07 15:55:35.063 INFO RaiFtp(1)[6] Response: 220 openload FTP server (report errors at http://openload.co)
2019-03-07 15:55:35.070 INFO RaiFtp(1)[6] Command: USER **
2019-03-07 15:55:35.394 INFO RaiFtp(1)[6] Response: 331 Password required for **.
2019-03-07 15:55:35.395 INFO RaiFtp(1)[6] Command: PASS **
2019-03-07 15:55:35.883 INFO RaiFtp(1)[6] Response: 230 User ** logged in from 61.77.193.117.
2019-03-07 15:55:35.885 INFO RaiFtp(1)[6] Command: FEAT
2019-03-07 15:55:36.209 INFO RaiFtp(1)[6] Response: 211-Extensions supported
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  EPRT
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  EPSV
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  PASV
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  SIZE
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  MDTM
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  UTF8
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response:  MLSD Type*;Size*;Modify*;Perm;UNIX.mode;UNIX.owner;UNIX.group
2019-03-07 15:55:36.574 INFO RaiFtp(1)[6] Response: 211 end
2019-03-07 15:55:36.577 INFO RaiFtp(1)[6] Command: OPTS UTF8 ON
2019-03-07 15:55:36.902 INFO RaiFtp(1)[6] Response: 200 Always in UTF8 mode.
2019-03-07 15:55:36.907 INFO RaiFtp(1)[6] Command: PWD
2019-03-07 15:55:37.232 INFO RaiFtp(1)[6] Response: 257 "/" is current directory.
2019-03-07 15:55:37.233 INFO RaiFtp(1)[6] Command: FEAT
2019-03-07 15:55:37.559 INFO RaiFtp(1)[6] Response: 211-Extensions supported
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  EPRT
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  EPSV
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  PASV
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  SIZE
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  MDTM
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  UTF8
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response:  MLSD Type*;Size*;Modify*;Perm;UNIX.mode;UNIX.owner;UNIX.group
2019-03-07 15:55:37.928 INFO RaiFtp(1)[6] Response: 211 end
2019-03-07 15:55:37.943 DEBUG RaiFtp(1)[6] Info: Starting data transfer.
2019-03-07 15:55:37.944 INFO RaiFtp(1)[6] Command: TYPE A
2019-03-07 15:55:38.269 INFO RaiFtp(1)[6] Response: 200 type set.
2019-03-07 15:55:38.272 INFO RaiFtp(1)[6] Command: PASV
2019-03-07 15:55:38.617 INFO RaiFtp(1)[6] Response: 227 Entering Passive Mode (185,163,108,43,188,210).
2019-03-07 15:55:38.620 DEBUG RaiFtp(1)[6] Info: Establishing data connection to 185.163.108.43:48338.
2019-03-07 15:55:38.621 DEBUG RaiFtp(1)[6] Proxy: Connecting to 185.163.108.43:48338 (no proxy).
2019-03-07 15:55:38.949 DEBUG RaiFtp(1)[6] Info: Established data connection from 192.168.1.12:12495.
2019-03-07 15:55:38.950 INFO RaiFtp(1)[6] Command: LIST
2019-03-07 15:55:40.723 INFO RaiFtp(1)[6] Response: 150 Opening ASCII mode data connection.
2019-03-07 15:55:40.730 DEBUG RaiFtp(1)[6] Info: Item: drwxrwxrwx 1 owner          group                4096 Mar 07 06:55 .subtitles
2019-03-07 15:55:40.746 DEBUG RaiFtp(1)[6] Info: Item: drwxrwxrwx 1 owner          group                4096 Mar 07 06:55 .videothumb
2019-03-07 15:55:40.746 DEBUG RaiFtp(1)[6] Info: Item: drwxrwxrwx 1 owner          group                4096 Mar 07 06:55 새 폴더 테스트 1
2019-03-07 15:55:40.746 DEBUG RaiFtp(1)[6] Info: Data transfer ended. 250 bytes transferred.
2019-03-07 15:55:40.748 DEBUG RaiFtp(1)[6] Info: Closing downloading data connection.
2019-03-07 15:55:40.750 DEBUG RaiFtp(1)[6] Info: Waiting for data transfer ending message.
2019-03-07 15:55:41.087 INFO RaiFtp(1)[6] Response: 226 Transfer complete.
2019-03-07 15:55:41.088 DEBUG RaiFtp(1)[6] Info: Data transfer ended.
2019-03-07 15:55:41.088 DEBUG RaiFtp(1)[6] Info: Transfer ended successfully.
2019-03-07 15:55:41.088 DEBUG RaiFtp(1)[6] Info: Data connection closed.
2019-03-07 15:55:41.089 INFO RaiFtp(1)[6] Command: SYST
2019-03-07 15:55:41.414 INFO RaiFtp(1)[6] Response: 215 UNIX Type: L8
2019-03-07 15:55:41.415 INFO RaiFtp(1)[6] Command: QUIT
2019-03-07 15:55:41.741 INFO RaiFtp(1)[6] Response: 221 Disconnected from openload FTP server (report errors at http://openload.co). Have a nice day. :-)

Answered: How to do passwordless file transfer without using password in ssh private key object ?

$
0
0

Hello,

1) If you already have private public key which was password encrypted, you have to use the password. There is no other way. However, if you can generate new one and want to use it later, you can use this short code

SshPrivateKey pk = SshPrivateKey.Generate();
pk.Save(@"C:\temp\private_key.ppk", null, SshPrivateKeyFormat.Putty);

When saving a key just provide null value into password parameter. Then use this generated key as you did before, but use null as well in the SshPrivateKey constructor.

2) You have to have the same key pair accessible on all your web farm servers. It is the same idea as connecting to your mailbox from your PC and your phone. You just authenticate on the application server as a user from different client devices/servers. If you do not need to differentiate source machine on your application server, it seems ok for me.

3) As I said in previous question answer, you have to have your key pairs accessible from all your web farms servers. Whether you copy your key pairs to all your servers or provide some shared files that your servers can load your keys, it doesn't matter. The path has to be physical path as you would browse it in a file manager application or a console. If you can open your key file using plain .NET functionality (like File.Open(key_path)), you should be fine with loading that key into SshPrivateKey/SshPublicKey objects.

POP3 Connection with TLS v1.2 don't work

$
0
0

I am using the 2018 R2. to connect to a server that only allows TLS 1.2, but the connection fails with an Timeout error.

I use this code for VB.NET

Dim client As New Pop3
client.Connect("testtls.pec.rupar.puglia.it", 995)

Can you help me

Thank you

Answered: Is source code for Rebex SFTP library included in the Company license?

$
0
0

Hi,

Rebex source code is not a part of Company license.
To get a quote for source code license please contact: support@rebex.net.

In case of Company licensed component, do we have to pay for each copy of our software we ship that includes it?

Fatal error 'ProtocolVersion'

$
0
0

Hello

I get this error on connect to pop3

I need to recover mails, is not the same as: http://forum.rebex.net/3358/tlsexception-fatal-error-protocolversion

       Dim m_pop3RemoteServerAddress = "pop3.example.org"
       Dim tlsParameters As TlsParameters = New TlsParameters
        tlsParameters.Version = TlsVersion.Any
        tlsParameters.AllowedSuites = TlsCipherSuite.All
        tlsParameters.CertificateVerifier = CertificateVerifier.AcceptAll
        tlsParameters.CommonName = m_pop3RemoteServerAddress

        client = New Pop3
        client.Settings.SslAllowedVersions = TlsVersion.Any
        client.Settings.SslAllowedSuites = TlsCipherSuite.All
        client.Settings.SslAcceptAllCertificates = True

        'client.Connect(m_pop3RemoteServerAddress, CInt(m_pop3Port), m_pop3SecurityMode)
        client.Connect(m_pop3RemoteServerAddress, CInt(m_pop3Port), tlsParameters, m_pop3SecurityMode)

The error: System.Exception: An error occurred: Fatal error 'ProtocolVersion' has been encountered on the local connection end.

Some help?
Thanks

Answered: In case of Company licensed component, do we have to pay for each copy of our software we ship that includes it?

How to get privatekey.ppk in ssh private key object in ssis package ruuning from sql server

$
0
0

Hi,

I am able to perform password less sftp in my local ssis package using ssh private key object referencing private key on my desktop.

But I have to deploy this ssis package in sql server which will then run by sql agent job. Where can I store the privatekey.ppk so that I can refer in ssis package in sql server?

Please let me know.

Thanks.


Ftp and Sftp exception status explanation

FileExists returns with false and FileRename return Directory Rename Error (450)

$
0
0

Logging into FileZilla, I can confirm that the file exists.

However, calling the rebex ftp client .FileExists always returns false.

Forcing it to do the rename (.Rename method) returns with a directory rename error. Any thoughts?

2019-03-19 17:03:04.052 Opening log file.
2019-03-19 17:03:04.058 INFO FileLogWriter(1)[11] Info: Assembly: Rebex.Common 2018 R4 for .NET 4.0-4.7
2019-03-19 17:03:04.065 INFO FileLogWriter(1)[11] Info: Platform: Windows 10.0.16299 64-bit; CLR: 4.0.30319.42000
2019-03-19 17:03:04.066 DEBUG FileLogWriter(1)[11] Info: Culture: en; Windows-1252
2019-03-19 17:03:58.891 INFO Ftp(1)[11] Info: Connecting to {redacted}:21 using Ftp.
2019-03-19 17:03:58.892 INFO Ftp(1)[11] Info: Assembly: Rebex.Ftp 2018 R4 for .NET 4.0-4.7
2019-03-19 17:03:58.892 INFO Ftp(1)[11] Info: Platform: Windows 10.0.16299 64-bit; CLR: 4.0.30319.42000
2019-03-19 17:03:58.892 DEBUG Ftp(1)[11] Info: Culture: en; Windows-1252
2019-03-19 17:03:58.893 INFO Ftp(1)[11] Info: Using proxy none.
2019-03-19 17:03:58.921 DEBUG Ftp(1)[11] Proxy: Connecting to {redacted}:21 (no proxy).
2019-03-19 17:03:59.183 DEBUG Ftp(1)[11] Info: Connection succeeded.
2019-03-19 17:03:59.439 INFO Ftp(1)[11] Response: 220 Hello, I'm freeFTPd 1.0
2019-03-19 17:04:04.836 INFO Ftp(1)[11] Command: USER imd_ph
2019-03-19 17:04:05.086 INFO Ftp(1)[11] Response: 331 Password required for imd_ph
2019-03-19 17:04:05.088 INFO Ftp(1)[11] Command: PASS **********
2019-03-19 17:04:05.339 INFO Ftp(1)[11] Response: 230 User imd_ph logged in
2019-03-19 17:04:05.340 INFO Ftp(1)[11] Command: FEAT
2019-03-19 17:04:05.592 INFO Ftp(1)[11] Response: 211-Extensions supported
2019-03-19 17:04:05.592 INFO Ftp(1)[11] Response: 211-MODE Z
2019-03-19 17:04:05.592 INFO Ftp(1)[11] Response: 211 End of FEAT
2019-03-19 17:06:12.759 INFO Ftp(1)[11] Command: TYPE I
2019-03-19 17:06:13.011 INFO Ftp(1)[11] Response: 200 TYPE set to BINARY
2019-03-19 17:06:13.063 INFO Ftp(1)[11] Command: SIZE .
2019-03-19 17:06:13.314 INFO Ftp(1)[11] Response: 550 .: No such file or directory.
2019-03-19 17:06:13.364 INFO Ftp(1)[11] Command: PWD
2019-03-19 17:06:13.616 INFO Ftp(1)[11] Response: 257 "/" is current directory
2019-03-19 17:06:13.667 INFO Ftp(1)[11] Command: SIZE /
2019-03-19 17:06:13.919 INFO Ftp(1)[11] Response: 550 /: No such file or directory.
2019-03-19 17:06:13.970 INFO Ftp(1)[11] Command: SIZE /b5a58610-8168-46a0-bb2f-d8a2b6be480f.mov
2019-03-19 17:06:14.222 INFO Ftp(1)[11] Response: 550 /b5a58610-8168-46a0-bb2f-d8a2b6be480f.mov: No such file or directory.
2019-03-19 17:06:22.819 INFO Ftp(1)[11] Command: RNFR /b5a58610-8168-46a0-bb2f-d8a2b6be480f.mov
2019-03-19 17:06:23.072 INFO Ftp(1)[11] Response: 350 Go ahead, enter destination name
2019-03-19 17:06:23.122 INFO Ftp(1)[11] Command: RNTO //New Name.mov
2019-03-19 17:06:23.375 INFO Ftp(1)[11] Response: 450 Directory rename error
2019-03-19 17:06:23.430 ERROR Ftp(1)[11] Info: Rebex.Net.FtpException: Directory rename error (450).
   at Rebex.Net.Ftp.aujt(Int32 cw, Boolean cx)
   at Rebex.Net.Ftp.aumn(String hv, String hw)
2019-03-19 17:06:36.769 INFO Ftp(1)[11] Command: SIZE //New Name.mov
2019-03-19 17:06:37.019 INFO Ftp(1)[11] Response: 213 110908443
2019-03-19 17:06:42.179 INFO Ftp(1)[11] Command: RNFR /b5a58610-8168-46a0-bb2f-d8a2b6be480f.mov
2019-03-19 17:06:42.430 INFO Ftp(1)[11] Response: 350 Go ahead, enter destination name
2019-03-19 17:06:42.480 INFO Ftp(1)[11] Command: RNTO //New Name.mov
2019-03-19 17:06:42.731 INFO Ftp(1)[11] Response: 450 Directory rename error
2019-03-19 17:06:42.732 ERROR Ftp(1)[11] Info: Rebex.Net.FtpException: Directory rename error (450).
   at Rebex.Net.Ftp.aujt(Int32 cw, Boolean cx)
   at Rebex.Net.Ftp.aumn(String hv, String hw)
2019-03-19 17:07:27.482 INFO Ftp(1)[11] Command: QUIT
2019-03-19 17:07:27.733 INFO Ftp(1)[11] Response: 221 Goodbye!

Error: The client and the server have no common algorithms

$
0
0

Hello,

I have this version:
Rebex.Net.Sftp = v4.0.30319

And recently our partner is upgrading their SSH host keys from
1028bits to 2048bits.

Additionally they are only going to accept three ciphers:

  1. aes256-ctr
  2. aes192-ctr
  3. aes128-ctr

and three MAC:

  1. hmac-sha256
  2. hmac-sha2-256
  3. hmac-sha2-512

So without making any code changes I tried to connect to their UAT server to start testing and I get this error...the error in the subject line.

I have no idea what the ciphers nor MAC mean, but I read other post to see if I could figure it out.

Here's what I found:

  1. I cannot log because I do not have RebEx.Common.dll anywhere on my system.
  2. I cannot change any settings because Settings is not a class in SFTP in my version.
  3. If I change the hostname back to production (because they have not roll in this change yet) I can connect (sftp.connect(hostname)) just fine.

So, I need helps please.

Thanks,
Ray

Answered: Ftp and Sftp exception status explanation

$
0
0

Basically, if you get Sftp/FtpException, the only reasonable thing you can do is to dispose the client object and reinitialize the connection.

The only case you can continue working with the client object is ProtocolError status, which means that the server is not able to perform requested operation, but the connection is still valid and the client recovered from error in safe way.
E.g. access denied, file does not exists on remote, etc.

For more information about exceptions thrown by Rebex components, please see also this thread.

Answered: How to get privatekey.ppk in ssh private key object in ssis package ruuning from sql server

$
0
0

Hi,

Even though SQL agent may have access to filesystem on the target server (depending on the user the SQL agent runs on), I would recommend you to store the private key as a string either in your source code or in some database table.

This approach requires two steps:

1) Have your private key in an appropriate text format.
You need a text file starting with
-----BEGIN ENCRYPTED PRIVATE KEY-----
If your private key is already in such format, skip this step.
If you have a PPK file, you have to convert it to the desired format. To achieve it, you can use our KeyGenerator utility. You can find it in the Samples folder of Rebex SFTP component.

  • start the KeyGenerator application
  • click on "Load" to load your PPK file
  • fill your passphrase to the "Passphrase" fields
  • click on "Save private key"

2) Construct the SshPrivateKey from string

  • From your text file, use only the text between the lines
    -----BEGIN ENCRYPTED PRIVATE KEY-----
    -----END ENCRYPTED PRIVATE KEY-----
  • Put it to your program or to your database.
  • Use the following code

    // load the private key from string
    string privateKeyText =@"...paste_your_key_here...";
    SshPrivateKey privateKey = new SshPrivateKey(Convert.FromBase64String(privateKeyText), "myTestPassword");
    
    // connect to a server 
    var client = new Sftp();
    client.Connect("sftp.example.com");
    
    // log in
    client.Login("tester", privateKey);
    

Why does Sftp.GetFile work but Sftp.GetDownloadStream does not?

$
0
0

Here's the log file when using GetDownloadStream:

INFO FileLogWriter(2)[6] Info: Assembly: Rebex.Common 2017 R6.3 for .NET 2.0-3.5
INFO FileLogWriter(2)[6] Info: Platform: Windows 6.2.9200 32-bit; CLR: 2.0.50727.9035
INFO SftpKeepAlive(1)[6] Info: Connecting to oracle12c:22 using Sftp.
INFO SftpKeepAlive(1)[6] Info: Assembly: Rebex.Sftp 2017 R6.3 for .NET 2.0-3.5
INFO SftpKeepAlive(1)[6] Info: Platform: Windows 6.2.9200 32-bit; CLR: 2.0.50727.9035
INFO SftpKeepAlive(1)[6] SSH: Negotiation started.
INFO SftpKeepAlive(1)[6] SSH: Negotiation finished.
INFO SftpKeepAlive(1)[6] Info: Server: SSH-2.0-WeOnlyDo 2.4.3
INFO SftpKeepAlive(1)[6] Info: Fingerprint (MD5): 90:05:6e:67:ea:01:b4:e3:aa:89:83:ca:a9:dd:63:3c
INFO SftpKeepAlive(1)[6] Info: Fingerprint (SHA-256): x6kGY2PXDCvRhrOv30P/+1Ri6C4XDKu10YmcrmwESnA
INFO SftpKeepAlive(1)[6] Info: Cipher info: SSH 2.0, diffie-hellman-group14-sha1, ssh-dss, aes256-ctr/aes256-ctr, hmac-sha2-256/hmac-sha2-256
INFO SftpKeepAlive(1)[6] Command: SSH_FXP_INIT (4)
INFO SftpKeepAlive(1)[6] Response: SSH_FXP_VERSION (3, 0 extensions)
INFO SftpKeepAlive(1)[6] Info: Using SFTP v3 on a Windows-like platform.
INFO SftpKeepAlive(1)[6] Command: SSH_FXP_STAT (1, '/BigFile.txt')
INFO SftpKeepAlive(1)[6] Response: SSH_FXP_ATTRS (1)
INFO SftpKeepAlive(1)[6] Command: SSH_FXP_STAT (2, '/BigFile.txt')
INFO SftpKeepAlive(1)[6] Response: SSH_FXP_ATTRS (2)
INFO SftpKeepAlive(3)[6] Info: Connecting to oracle12c:22 using Sftp.
INFO SftpKeepAlive(3)[6] Info: Assembly: Rebex.Sftp 2017 R6.3 for .NET 2.0-3.5
INFO SftpKeepAlive(3)[6] Info: Platform: Windows 6.2.9200 32-bit; CLR: 2.0.50727.9035
INFO SftpKeepAlive(3)[6] SSH: Negotiation started.
INFO SftpKeepAlive(3)[6] SSH: Negotiation finished.
INFO SftpKeepAlive(3)[6] Info: Server: SSH-2.0-WeOnlyDo 2.4.3
INFO SftpKeepAlive(3)[6] Info: Fingerprint (MD5): 90:05:6e:67:ea:01:b4:e3:aa:89:83:ca:a9:dd:63:3c
INFO SftpKeepAlive(3)[6] Info: Fingerprint (SHA-256): x6kGY2PXDCvRhrOv30P/+1Ri6C4XDKu10YmcrmwESnA
INFO SftpKeepAlive(3)[6] Info: Cipher info: SSH 2.0, diffie-hellman-group14-sha1, ssh-dss, aes256-ctr/aes256-ctr, hmac-sha2-256/hmac-sha2-256
INFO SftpKeepAlive(3)[6] Command: SSH_FXP_INIT (4)
INFO SftpKeepAlive(3)[6] Response: SSH_FXP_VERSION (3, 0 extensions)
INFO SftpKeepAlive(3)[6] Info: Using SFTP v3 on a Windows-like platform.
INFO SftpKeepAlive(3)[6] Command: SSH_FXP_OPEN (1, '/BigFile.txt', 1)
INFO SftpKeepAlive(3)[6] Response: SSH_FXP_HANDLE (1, 0x776F645366747046696C6548616E646C6530)
ERROR SftpKeepAlive(3)[6] SSH: Rebex.Net.SshException: The SSH connection failed.
   at Rebex.Net.SshSession.PF(PE I, Boolean J)
   at Rebex.Net.SshChannel.DJ(PE I)
   at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)
ERROR SftpKeepAlive(3)[6] SSH: Rebex.Net.SshException: The channel has been closed.
   at Rebex.Net.SshChannel.Send(Byte[] buffer, Int32 offset, Int32 count)

Answered: Identify server state

$
0
0

SFTP runs over SSH. To determine whether a server is listening at a particular port, just try connecting it using System.Net.Sockets.Socket class and receive the identification string.
If you would like to determine that an SSH server is really up and running, you can use Rebex Sftp, Ssh or SshSession class to connect to the server and negotiate an SSH session. If this works, the server is up and running. If it doesn't, there is an issue and you can use SftpException's or SshExceptions's Status property to determine what's going on. However, this of course doesn't really determine whether the SFTP subsystem for a particular user would work. The only reasonable way to determine that would be to authenticate as well and try establishing an SFTP channel (in other words, to call Sftp's Connect method followed by Login method).

TFTP is a very old and very simple file transfer protocol that runs over UDP. To determine if it's running, hopefully you could send a request and wait for proper response according to the protocol. However, we currently don't provide any TFTP library and are not familiar with the protocol, so this is outside the scope of our support.

As for Modbus - if you use Modbus over SSH, what I wrote about SFTP would apply as well. Otherwise, to determine whether a Modbus over TCP is availalbe, again try connecting to it using System.Net.Sockets.Socket.


Error while starting data transfer: Rebex.Net.FtpException: I won't open a connection to IP

$
0
0

Hello!

I'm attempting to transfer data with Rebex Win Forms client but get the error: 500 I won't open a connection to 10.0.38.104 (only to 81.106.223.248)

The Verbose log:

12:38:21.334 Info Command: PROT P

12:38:21.342 Verbose TLS: Received TLS packet:

0000 |17-03-03-00-2C-32-30-30 20-44-61-74-61-20-70-72| ....,200 Data
pr

0010 |6F-74-65-63-74-69-6F-6E 20-6C-65-76-65-6C-20-73| otection level
s

0020 |65-74-20-74-6F-20-22-70 72-69-76-61-74-65-22-0D| et to
"private".

0030 |0A | .

12:38:21.342 Verbose Info: Received data over control connection:

0000 |32-30-30-20-44-61-74-61 20-70-72-6F-74-65-63-74| 200 Data
protect

0010 |69-6F-6E-20-6C-65-76-65 6C-20-73-65-74-20-74-6F| ion level set
to

0020 |20-22-70-72-69-76-61-74 65-22-0D-0A | "private"..

12:38:21.342 Info Response: 200 Data protection level set to "private"

12:38:21.343 Verbose TLS: Sent TLS packet:

0000 |17-03-03-00-08-54-59-50 45-20-41-0D-0A | .....TYPE A..

12:38:21.343 Verbose Info: Sent data over control connection:

0000 |54-59-50-45-20-41-0D-0A | TYPE A..

12:38:21.343 Info Command: TYPE A

12:38:21.350 Verbose TLS: Received TLS packet:

0000 |17-03-03-00-17-32-30-30 20-54-59-50-45-20-69-73| .....200 TYPE
is

0010 |20-6E-6F-77-20-41-53-43 49-49-0D-0A | now ASCII..

12:38:21.351 Verbose Info: Received data over control connection:

0000 |32-30-30-20-54-59-50-45 20-69-73-20-6E-6F-77-20| 200 TYPE is
now

0010 |41-53-43-49-49-0D-0A | ASCII..

12:38:21.351 Info Response: 200 TYPE is now ASCII

12:38:21.363 Debug Info: Listening for data connection at
10.0.38.104:60999.

12:38:21.365 Verbose TLS: Sent TLS packet:

0000 |17-03-03-00-19-50-4F-52 54-20-31-30-2C-30-2C-33| .....PORT
10,0,3

0010 |38-2C-31-30-34-2C-32-33 38-2C-37-31-0D-0A | 8,104,238,71..

12:38:21.365 Verbose Info: Sent data over control connection:

0000 |50-4F-52-54-20-31-30-2C 30-2C-33-38-2C-31-30-34| PORT
10,0,38,104

0010 |2C-32-33-38-2C-37-31-0D 0A | ,238,71..

12:38:21.365 Info Command: PORT 10,0,38,104,238,71

12:38:21.373 Verbose TLS: :

0000 |17-03-03-00-47-35-30-30 20-49-20-77-6F-6E-27-74| ....G500 I
won't

0010 |20-6F-70-65-6E-20-61-20 63-6F-6E-6E-65-63-74-69| open a
connecti

0020 |6F-6E-20-74-6F-20-31-30 2E-30-2E-33-38-2E-31-30| on to
10.0.38.10

0030 |34-20-28-6F-6E-6C-79-20 74-6F-20-38-31-2E-31-30| 4 (only to
81.10

0040 |36-2E-32-32-33-2E-32-34 38-29-0D-0A | 6.223.248)..

12:38:21.373 Verbose Info: Received data over control connection:

0000 |35-30-30-20-49-20-77-6F 6E-27-74-20-6F-70-65-6E| 500 I won't
open

0010 |20-61-20-63-6F-6E-6E-65 63-74-69-6F-6E-20-74-6F| a connection
to

0020 |20-31-30-2E-30-2E-33-38 2E-31-30-34-20-28-6F-6E| 10.0.38.104
(on

0030 |6C-79-20-74-6F-20-38-31 2E-31-30-36-2E-32-32-33| ly to
81.106.223

0040 |2E-32-34-38-29-0D-0A | .248)..

12:38:21.373 Info Response: 500 I won't open a connection to
10.0.38.104 (only to 81.106.223.248)

12:38:21.381 Debug Info: Error while starting data transfer:
Rebex.Net.FtpException: I won't open a connection to 10.0.38.104 (only
to 81.106.223.248) (500).

at Rebex.Net.Ftp.aujt(Int32 cw, Boolean cx)

at Rebex.Net.Ftp.aujy(EndPoint dc)

at Rebex.Net.Ftp.aukg(String dm, Boolean dn, ychh dp, snfi dq,
Int64 dr, FtpTransferState ds)

12:38:21.382 Debug Info: Error while initializing data connection.

12:38:21.383 Error Info: Rebex.Net.FtpException: I won't open a
connection to 10.0.38.104 (only to 81.106.223.248) (500).

at Rebex.Net.Ftp.aujt(Int32 cw, Boolean cx)

at Rebex.Net.Ftp.aujy(EndPoint dc)

at Rebex.Net.Ftp.aukg(String dm, Boolean dn, ychh dp, snfi dq,
Int64 dr, FtpTransferState ds)

at Rebex.Net.Ftp.aumh(String hi, Boolean hj, Stream hk, Int64 hl,
String hm, snfi hn)

12:38:21.383 Error Info: Rebex.Net.FtpException: I won't open a
connection to 10.0.38.104 (only to 81.106.223.248) (500).

at Rebex.Net.Ftp.aujt(Int32 cw, Boolean cx)

at Rebex.Net.Ftp.aujy(EndPoint dc)

at Rebex.Net.Ftp.aukg(String dm, Boolean dn, ychh dp, snfi dq,
Int64 dr, FtpTransferState ds)

at Rebex.Net.Ftp.aumh(String hi, Boolean hj, Stream hk, Int64 hl,
String hm, snfi hn)

Any thoughts or ideas?
Thanks in advance.

Answered: How to convert MSG to MBOX in a simple way?

$
0
0

According to RFC 4135, MBOX format stores mailbox messages in RFC 2822 format and only differs in several aspects from it:

  • Unix end-of-line sequence (0A) is used instead of Windows end-of-line sequence (0D 0A).
  • Messages must be 7-bit (no 8-bit MIME or binary MIME).
  • Each newly added message is terminated with a completely empty line.

Rebex Secure Mail already supports conversion of Outlook MSG files to the MIME format (an extension of RFC 2822), so implementing a custom utility that performs MSG to MBOX conversion should be quite simple. Our MSG-to-MIME and MIME-to-MSG conversion utility (comes with source code) could be used as a base.

However, the lack of 8-bit MIME means that some messages, such as signed messages using 8-bit MIME or binary MIME, cannot be represented as required by RFC 4135. However, MBOX format was never formally defined (it's mostly a generic term for a family of related file formats), so this might not actually be an issue.

Answered: Error while starting data transfer: Rebex.Net.FtpException: I won't open a connection to IP

$
0
0

You are using FTP Active mode, which is problematic in your case: client behind firewall connects to a FTP server outside firewall.

The problem is, that the client reported to the FTP server its local address, which the FTP server cannot connect to.

Please, try to use FTP Pasive mode instead.

Getting InvalidOperationException after disconnecting and connecting back to FTP server.

$
0
0

I am connecting to the FTP server using FileTransferClient. It connects and logs in perfectly. But if I disconnect the connection and try connect again using same FileTransferClient object, I get InvalidOperationException. Message says client is already connected.

System.InvalidOperationException: Client is already connected.
   at Rebex.Net.FileTransferClient.fmlo()
   at Rebex.Net.FileTransferClient.ConnectAsync(String serverName, Int32 serverPort, FileTransferMode transferMode, Object state)

Rebex log:

2019-05-21 16:55:46.991 INFO FileTransferClient(1)[3] Response: 220-FileZilla Server 0.9.60 beta
2019-05-21 16:55:46.993 INFO FileTransferClient(1)[3] Response: 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
2019-05-21 16:55:46.993 INFO FileTransferClient(1)[3] Response: 220 Please visit https://filezilla-project.org/
2019-05-21 16:55:47.050 INFO FileTransferClient(1)[3] Command: USER admin
2019-05-21 16:55:47.051 INFO FileTransferClient(1)[3] Response: 331 Password required for admin
2019-05-21 16:55:47.055 INFO FileTransferClient(1)[3] Command: PASS **********
2019-05-21 16:55:47.055 INFO FileTransferClient(1)[3] Response: 230 Logged on
2019-05-21 16:55:47.058 INFO FileTransferClient(1)[3] Command: FEAT
2019-05-21 16:55:47.058 INFO FileTransferClient(1)[3] Response: 211-Features:
2019-05-21 16:55:47.058 INFO FileTransferClient(1)[3] Response:  MDTM
2019-05-21 16:55:47.058 INFO FileTransferClient(1)[3] Response:  REST STREAM
2019-05-21 16:55:47.058 INFO FileTransferClient(1)[3] Response:  SIZE
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  MLST type*;size*;modify*;
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  MLSD
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  UTF8
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  CLNT
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  MFMT
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  EPSV
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response:  EPRT
2019-05-21 16:55:47.059 INFO FileTransferClient(1)[3] Response: 211 End
2019-05-21 16:55:47.072 INFO FileTransferClient(1)[3] Command: SYST
2019-05-21 16:55:47.072 INFO FileTransferClient(1)[3] Response: 215 UNIX emulated by FileZilla
2019-05-21 16:55:47.073 INFO FileTransferClient(1)[3] Command: OPTS UTF8 ON
2019-05-21 16:55:47.073 INFO FileTransferClient(1)[3] Response: 202 UTF8 mode is always enabled. No need to send this command.
2019-05-21 16:55:47.081 INFO FileTransferClient(1)[7] Command: QUIT
2019-05-21 16:55:47.081 INFO FileTransferClient(1)[7] Response: 221 Goodbye

Sftp.PutFile() doesn't fail, but server doesn't get the file, what could be the possible reason?

$
0
0

How do we know that PutFile() has failed? what are the exceptions it throws, if any?

The problem, we are facing is that on calling PutFile() it returns the number of bytes equal to the size of the file which is to be uploaded, but when we checked on server, the file is missing from there. What could be the possible causes?

code snippet:
long result = sftpClient.PutFile(filePath, string.Format("/{0}/{1}", pathToPlaceFile, fileNameToBeTransferred));

Viewing all 3858 articles
Browse latest View live