We have a winner: setting usePAM to no generates the issue:
/etc/ssh/sshd_config
-------------------------------
...
usePAM no

ChallengeResponseAuthentication no
PasswordAuthentication no
PermitEmptyPasswords no
...

ssh -v  root@localhost
---------------------------------
...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Offering ED25519 public key: /root/.ssh/id_ed25519
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

However, setting usePAM to yes makes the session work:
/etc/ssh/sshd_config
-------------------------------
...
use PAM yes

ChallengeResponseAuthentication no
PasswordAuthentication no
PermitEmptyPasswords no
...

ssh -v root@localhost
--------------------------------
...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /root/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
Enter passphrase for key '/root/.ssh/id_rsa': 
debug1: Authentication succeeded (publickey).
Authenticated to localhost ([::1]:xxx).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessi...@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys...@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-19-generic x86_64)
...

** Information type changed from Private Security to Public Security

** Summary changed:

- Permission denied (publickey) whereas the public key has been inserted into  
~/.ssh/authorized_keys
+ Permission denied (publickey) whereas the public key has been inserted into  
~/.ssh/authorized_keys: usePAM no issue

** Summary changed:

- Permission denied (publickey) whereas the public key has been inserted into  
~/.ssh/authorized_keys: usePAM no issue
+ Permission denied (publickey) whereas the public key has been inserted into  
~/.ssh/authorized_keys: "usePAM no" issue

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to openssh in Ubuntu.
https://bugs.launchpad.net/bugs/1522190

Title:
  Permission denied (publickey) whereas the public key has been inserted
  into  ~/.ssh/authorized_keys: "usePAM no" issue

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1522190/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to