samba Notes

Attempting to connect to a windows share, on a domain, in kubuntu 18.04 and I encountered some issues. (Note: ran into this in CentOS7, ubuntu 16.04, 14.04 and others)

Normally smb://server/share/ would work in my file browser (using kde the file browser is dolphin)

When I ran some tests:

smbclient -L servername

I received the error:

SPNEGO(gse_krb5) NEG_TOKEN_INIT failed: NT_STATUS_NO_MEMORY

Looking around there were references to adjusting settings in smb.conf (adding ‘client max protocol = NT1’ did not help).

I recalled something like this from years ago so I looked back in my notes.

Keep in mind this is on an active directory domain so this will need to be adjusted to your domain.

sudo apt install krb5-user libpam-krb5

Edit the /etc/krb5.conf

[logging]
      default = FILE:/var/log/krb5lib.log
  [libdefaults]
      ticket_lifetime = 24000
      default_realm = DOMAIN
      default_tkt_enctypes = RC4-HMAC des3-hmac-sha1 des-cbc-crc
      default_tgs_enctypes = RC4-HMAC des3-hmac-sha1 des-cbc-crc
  [realms]
  DOMAIN = {
       kdc = server.domain
       admin_server = server.domain
       default_domain = domain
  }
  [domain_realm]
      .domain = DOMAIN
      domain = DOMAIN

Unsure if case is necessary.

Now see if you can authenticate:

$ kinit user
Password for user@DOMAIN: ...
$ klist
Ticket cache: FILE:/tmp/krb5cc_1000
Default principal: user@DOMAIN

Valid starting       Expires              Service principal
05/30/2018 08:47:22  05/30/2018 18:47:22  krbtgt/DOMAIN@DOMAIN
        renew until 05/31/2018 08:47:19

Once this was working, I was able to navigate to smb://server/share in dolphin and connect to my shares.

Hope this helps out if you are stuck with the same issue.