Download
We're evolving to serve you better! This current forum has transitioned to read-only mode. For new discussions, support, and engagement, we've moved to GitHub Discussions.

Can’t connect to sftp server

  • #3336
    Avatar photo[anonymous]

    I have verified that connecting to my server using sftp in the terminal works fine (`sftp sftp://username@example.com/var/www/html/blog`) but for some reason Publii won’t connect. When I test connection, I just get the message “Error! Application was unable to connect with your server.” I am using password authentication.

    Any help is appreciated, I’m completely stuck.

    #3337
    Avatar photo[anonymous]

    Hi,

    How did you configured your SFTP settings in Publii? Could you provide us an anonymised example?

    #3344
    Avatar photo[anonymous]

    Thank you for the response, here is my configuration:

    Type: SFTP

    Domain: https:// example.com

    Port: 22

    Server: example.com

    Username: username

    Authentication method: Password

    Password: s3cr3t

    Remote path: /absolute/path/to/blog/

    #3352
    Avatar photo[anonymous]

    Looks correct… Could you try to sync (of course it won’t work) and then check logs in Tools -> Log viewer? Especially the deployment-errors.log and deployment-process.log files?

    #3354
    Avatar photo[anonymous]

    All error logs are empty, deployment-process.log just says ERR (1): undefined

    #3355
    Avatar photo[anonymous]

    Could you provide me a temporary access to your SFTP in a private reply?

    Unfortunately all my servers which uses SFTP uses key-based authentication. I suppose that there can be some bug during preparing a connection in the SFTP library.

    #3356
    Avatar photo[anonymous]

    I cannot do that; the server belongs to the company I work for and I cannot give outside access.

    #3357
    Avatar photo[anonymous]

    So at this moment the only solution to deploy the website is to use manual upload – it will generate the output files which can be manually uploaded to the server.

    #3358
    Avatar photo[anonymous]

    That’s not going to work for us. Do you have plans to support sftp password authentication?

    Ideally we would use key authentication, but we require a system that can support multiple non-technical users–they do not have the knowledge or means to generate and manage keys. Publii appears to provide sftp password authentication based on the options available in the interface, but I believe you are saying that it hasn’t been tested and that, based on my report here, it is broken.

    Please let me know if I misunderstood; but if I do understand correctly then I would recommend removing the sftp password authentication feature, as it may save the next person from spending time trying to fix a server issue that doesn’t exist.

    #3364
    Avatar photo[anonymous]

    Hi again,

    I have checked SFTP auth with password and key after requesting my dev ops to change server configuration and allow password auth for SFTP.

    In both cases it works fine – app connects with server and then allow me to upload a website.

    I got only one issue – the sync stopped at 0 operations, but the problem was caused by a wrong remote path in the server configuration. After fixing a path it was ok.

    I suppose that your server is somehow incompatible with a SFTP library used in Publii or something is wrong with your server settings in Publii (but for me it looks correct).

    #3618
    Avatar photo[anonymous]

    Exactly the same issue here. Everything was working fine on June 6, when I did a successful sync with 36.0 release 5.  Now the 36.1 and the release 5 don’t work. Not sure why this happened. I’m on Mac 10.15.6

    I use serverpilot to create an “App” on  google cloud. It worked perfectly.

    Connecting with Transmit works. Connecting with Publii gives a connection error and temporarily blocks IP access to the server.

    #3664
    Avatar photo[anonymous]

    @Mickeyx – please check if the remote path is ok and if the connection test is successful. Publii tries to write a file in the pointed directory to make sure that it will be able to upload your website.

    #4671
    Avatar photo[anonymous]

    I managed to solve the mistery. Unfortunately Publii doesn’t log anything about the connection failure. The problem was that when you enter password, Publii is authenticating with password (clear text) authentication and not keyboard-interactive. This is disabled by default on the ssh server because of security reasons and I don’t recommend to use it. Unfortunately keyboard-interactive is not supported so you should use authentication key instead.