Page 1 of 1

SFTP impossible to connect to IONOS

Posted: Sat Nov 02, 2024 9:29 pm
by Kwai chang caine
Hello at all

I don't understand why, but impossible to connect to my IONOS server with the team example code :|
Then that works perfectly with FileZilla and WinSCP :shock:

Code: Select all

If OpenFTP(0, "sftp://212.227.XXX.XX", "XX", "XXXXXX", 0, 22)

  Result = SendFTPFile(0, OpenFileRequester("Choose a file to send", "", "*.*", 0), "purebasic_sent.file", 1)
  
  Repeat
    Debug FTPProgress(0)
    Delay(300)
  Until FTPProgress(0) = #PB_FTP_Finished Or FTPProgress(0) =  #PB_FTP_Error

  Debug "finished"
  
Else
  MessageRequester("Error", "Can't connect to the FTP server")
EndIf
If someone know why ?

Have a good day

Re: SFTP impossible to connect to IONOS

Posted: Sat Nov 02, 2024 9:47 pm
by idle
Did you try port 990 ?

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 11:16 am
by infratec
You have to look in your configuartion at ionos:

https://www.ionos.de/hilfe/index.php?id=2940

There you can find the used port.

In general:

Linux hosting: Protocol SFTP 22
Windows hosting: Port FTP over TLS (FTPS) 990

What kind of host is it?

An tell us if the connection fail, or the file transfer.

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 5:32 pm
by Kwai chang caine
Hello at you two,

Thanks a lot for your help
I'm very happy to can talk to you another time, since this long time 8)

I have try the port 990 and it's not better :|
I have a LINUX server, the name of the contract is "IONOS Serveur Virtuel Cloud S"

With Fillezilla and WinSCP, i enter exactely the same IP for the HOSTNAME, Login = "root" and the same password and that works perfectly :shock:
Infratec wrote:An tell us if the connection fail, or the file transfer.
I have the MsgBox "Can't connect to the FTP server" with this code

Why even the most simple things... is always difficult for KCC ? :cry:

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 5:42 pm
by Kwai chang caine
I have found something, for be sure, i have cut the firewall of W10 :idea:
And here..miracle that works !!! :shock:
Then i have enable the Firewall like it is when i have created this thread, and that always works :shock: :shock:
I don't understand anything, that works now, but i don't know why :oops:

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 7:53 pm
by PBJim
Kwai chang caine wrote: Sun Nov 03, 2024 5:42 pm I have found something, for be sure, i have cut the firewall of W10 :idea:
And here..miracle that works !!! :shock:
Then i have enable the Firewall like it is when i have created this thread, and that always works :shock: :shock:
It's often the case, disable the firewall and all is well. :D

The reason for this is that when an FTP session is made, the server makes another connection back to your client, so there are two sessions. One is the command session and the other is for data. In cases where this isn't possible, FTP has passive mode, which is a workaround, using a single session. The command is PASV. I just checked up, to make sure I'm not telling you a load of rubbish and the below confirms :

https://stackoverflow.com/questions/169 ... assive-ftp

I can't remember the reason for the incoming connection still working after you re-enabled the firewall. It may be due to your router remembering the last session.

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 8:10 pm
by Kwai chang caine
Thanks for your explanation 8)
Decidedly....the network is really difficult to understand :| again more with all this security all the days more and more present ...

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 8:18 pm
by PBJim
Kwai chang caine wrote: Sun Nov 03, 2024 8:10 pm Thanks for your explanation 8)
Decidedly....the network is really difficult to understand :| again more with all this security all the days more and more present ...
Yeah, I know it can be a pain at times. I really don't like SELinux because the thing is so complicated and we only have limited time, so most of the time we just disable it. :D

Maybe PB has passive mode in its FTP, but I'm not sure because I haven't kept up-to-date with it.

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 8:35 pm
by Kwai chang caine
Yes this option apparently exist 8)
Passive (optional) Enables or disables passive mode for the connection (valid values are #True or #False). If this parameter is not specified, passive mode will be used.
https://www.purebasic.com/documentation ... enftp.html

Re: SFTP impossible to connect to IONOS

Posted: Sun Nov 03, 2024 8:39 pm
by PBJim
Kwai chang caine wrote: Sun Nov 03, 2024 8:35 pm Yes this option apparently exist 8)
Passive (optional) Enables or disables passive mode for the connection (valid values are #True or #False). If this parameter is not specified, passive mode will be used.
https://www.purebasic.com/documentation ... enftp.html
Yes, I see that passive is the default anyway. Perhaps IONOS doesn't support it.