question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Public key authentication not working in version 3

See original GitHub issue

Hi!

I set up emberstack/sftp as an Azure container Instance. I tried to configure public key authentication, but as soon as I set the password to "" or null I can’t login anymore. Here is my configuration:

{
  "Global": {
    "Chroot": {
      "Directory": "%h",
      "StartPath": "sftp"
    },
    "Directories": [
      "sftp"
    ],
    "HostKeys": {
      "Ed25519": "[MY HOST ED25519 PRIVATE KEY]",
      "Rsa": "[MY HOST RSA PRIVATE KEY]"
    }
  },
  "Users": [
    {
      "Username": "myuser",
      "Password": "",
      "PublicKeys": [
        "[MY USER PUBLIC KEY]"
      ]
    }
  ]
}

Log output when using sshfs:

2020-06-19 14:41:05.388 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - PAM: Authentication failure for myuser from 10.240.255.56
2020-06-19 14:41:05.455 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - Connection closed by authenticating user myuser 10.240.255.56 port 46479 [preauth]
2020-06-19 14:41:18.675 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - PAM: Authentication failure for myuser from 10.240.255.56
2020-06-19 14:41:20.855 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - PAM: Authentication failure for myuser from 10.240.255.56
2020-06-19 14:41:20.895 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - Postponed keyboard-interactive for myuser from 10.240.255.56 port 59492 ssh2 [preauth]
2020-06-19 14:41:23.242 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - PAM: Authentication failure for myuser from 10.240.255.56
2020-06-19 14:41:23.589 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - Failed none for myuser from 10.240.255.56 port 59492 ssh2
2020-06-19 14:41:24.117 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - Failed password for myuser from 10.240.255.56 port 59492 ssh2
2020-06-19 14:41:24.126 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - maximum authentication attempts exceeded for myuser from 10.240.255.56 port 59492 ssh2 [preauth]
2020-06-19 14:41:24.126 [VRB] (ES.SFTP.Host.SSH.SSHService) sshd - Disconnecting authenticating user myuser 10.240.255.56 port 59492: Too many authentication failures [preauth]

When I use Filezilla, more or less the same thing happens.

EDIT: shortened log

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
antoinedeschenescommented, Jun 25, 2020

@tibarix feature was added in 2.0.12

0reactions
winromuluscommented, Jun 26, 2020

@antoinedeschenes @josefschabasser - Fixed the issue by setting home directory permissions to 711. I do not want to set them to 755 unless there’s very good reasons to. I’ve tested this and it works with public keys now. Give it a spin if you can and if the problem persists, reopen the issue please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Troubleshoot SSH Authentication Issues
This walkthrough covers the two most common: password and private/public key pair. Prerequisites to Troubleshooting SSH Issues.
Read more >
Can't get SSH public key authentication to work [closed]
I had a similar problem - remote PC couldn't use public key authentication to log in to CentOs 6 server. The problem in...
Read more >
Troubleshoot SSH Key Authentication Issues | Linode Docs
Learn the basics of SSH keys and how to troubleshoot the most common SSH permission issues in this short guide.
Read more >
SSH-Key authentication fails
This will usually resolve most SSH authorized key permission issues on the server side, assuming someone didn't make additional changes to ...
Read more >
Public Key authentication issues with Linux / Unix SSH client.
When trying to import an SSH user key from a Linux client, I get an error: "Save Error. Failed to import RSA/DSA Key."...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found