1

I have imported from what I can tell successfully the sshPublicKey schema but the attribute doesn't show in PHPLDAPADMIN.

Anybody have any experience with this issue?

What I did verbatim :

sudo nano openssh-lpk.ldif

dn: cn=openssh-lpk,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: openssh-lpk
olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey'
  DESC 'MANDATORY: OpenSSH Public key'
  EQUALITY octetStringMatch
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )
olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY
  DESC 'MANDATORY: OpenSSH LPK objectclass'
  MAY ( sshPublicKey $ uid )
  )

Import the schema, should I change ldapi://? I tried using my IP/Loopback and it doesn't work, but it seems to work as is.

ldapadd -Y EXTERNAL -H ldapi:/// -f openssh-lpk.ldif

Got this from this guide here >> https://blog.shichao.io/2015/04/17/setup_openldap_server_with_openssh_lpk_on_ubuntu.html

Confirmed its what I'm supposed to via this post on SF.

SSH key authentication using LDAP

But his instructions are a bit vague...

"Update LDAP to include the OpenSSH-LPK schema"

We first need to update LDAP with a schema to add the sshPublicKey attribute for users:

How? What am I doing wrong?

Thanks,

PS: This is the output of me running the command, all seems well, it even says "Duplicate"

root@ldap:~# ldapadd -Y EXTERNAL -H ldapi:/// -f openssh-lpk.ldif
SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
adding new entry "cn=openssh-lpk,cn=schema,cn=config"
ldap_add: Other (e.g., implementation specific) error (80)
        additional info: olcAttributeTypes: Duplicate attributeType: "1.3.6.1.4.1.24552.500.1.1.1.13"

UPDATE: I can see the schema in PHPLDAPADMIN, but its not under the PosiX Account, can somebody post the attribute tag from /etc/phpldapadmin/templates/creation/posixAccount.xml

enter image description here

FreeSoftwareServers
  • 571
  • 1
  • 6
  • 25

1 Answers1

9

Since this was really a GUI Issue, (another example of why its best to learn things on the CLI), my answer will be a Picture. But long story short is I was reading the directions to fast!

"Adding a user with SSH public key in phpLDAPadmin

First, create a user with the “Generic: User Account” template. Then, go to the “objectClass” attribute section, click “add value”, and choose the “ldapPublicKey” attribute. After you submit, go back to the user edit page, click “Add new attribute” on the top part, and choose “sshPublicKey”, paste the public key into the text area, and finally click “Update Object”."

enter image description here

FreeSoftwareServers
  • 571
  • 1
  • 6
  • 25