0

I am trying to setup SFTP on my server and I'm having trouble. I can already log into the server fine with SSH using key authentication, but when connecting with FileZilla over SFTP I get the error: Disconnected: No supported authentication methods available (server sent: publickey). Trying to upload a file using the sftp or scp commands both give me a similar error.

I have password authentication off right now, but I tested it with it turned on and I get an Authentication Failed error over SFTP instead.

I know this has been posted about a hundred times before but I couldn't find anyone that was getting the exact same error as me.

4
  • Try with the command line tool sftp. If it works, the problem is Filezilla. (I think this is the case, and then you can use the file browser, if you want a GUI tool, for example Nautilus, Thunar or Pcmanfm depending on the flavour of Ubuntu). See the following link, askubuntu.com/questions/966229/…
    – sudodus
    Feb 6, 2018 at 18:14
  • @sudodus Using the sftp command gives me Permission denied (publickey). Couldn't read packet: Connection reset by peer. Feb 6, 2018 at 18:29
  • You need to configure our FileZilla to serve the proper private key for SSH connection - same for a command line client. Failing that, you can't make it work with a "publickey only" server.
    – Thomas Ward
    Feb 6, 2018 at 18:34
  • 1
    sftp and ssh work for me with very similar syntax also using key authentication. Please describe the ssh command line, that works for you.
    – sudodus
    Feb 6, 2018 at 18:44

1 Answer 1

1

The core problem is that your SFTP server requires SSH Key Authentication to properly permit connections. You mentioned with FileZilla, so I've written this answer as such.

For Filezilla, you can use this for non-password-protected SSH keys:

  1. Open the FileZilla client.
  2. From the top of the home screen, click on Edit and select Settings.
  3. On the left side of the menu, expand the Connection section and highlight SFTP.

    SFTP settings

  4. Click on the [Add keyfile...] button and browse your local machine's directories and select your Private Key file.

  5. Then, again from the top of FileZilla's home screen, click on File and select Site Manager.
  6. Finally, on the left side of the Site Manager, click on the New Site button and type a unique name under My Sites that will allow you to easily identify this particular remote server in the future.

  7. Now, under the General tab, fill in the Host (with either an IP address or FQDN) and Port fields (default is 22).

  8. In the Protocol dropdown menu, select SFTP - SSH File Transfer Protocol.
  9. In the Logon Type dropdown menu, select Interactive.

If your SSH key is password-protected then you'll need to use something else.


This said, there is usually a way to use SFTP in most GUIs. On Ubuntu 16.04, Nautilus has an "Connect to Server" button (there's a similar function in most of the other GUI file browsers) where you can specify sftp://user@remotelocation:22/path/on/server and it should integrate with the ssh-agent tool that is usually already running and indexing your keys. That should then just 'work' without having to do anything funny, and obeys the SFTP rules.

4
  • 1
    Well, I added my private key file in the FileZilla settings and no luck. I get the same error still. I get a permission denied error when using the file browser. Feb 6, 2018 at 18:52
  • @ChrisHansen and you're sure that the SSH key is actually the proper one or your user account, and that you're providing the proper user account for logon?
    – Thomas Ward
    Feb 6, 2018 at 18:55
  • It's the only key I have on this computer. But actually I just tried logging in as a different user and that one actually worked. I'm a little bit new to this but are SSH keys tied to a specific user? Do I need to generate a new key for each user? Feb 6, 2018 at 19:00
  • @ChrisHansen, Yes, you need a key [pair] for each user. (It might be copied from another user, but I suggest you have unique keys for each user).
    – sudodus
    Feb 6, 2018 at 19:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .