I have a server, Ubuntu 16.04, exporting an NFS share with Kerberos security. I have a laptop client, Ubuntu 17.10, that connects to the server. The client is configured to mount the share using autofs. I created a keytab on the server and copied it onto the client.
I am able to reach the share. However, it doesn't work immediately on login on the laptop; the directory mounts, but in a strange state where I don't really have permission to use it.
In order to make it work, I have to do EITHER
sudo service rpc-gssd restart
kinit [type in password when prompted]
After either of those, I am able to browse to the mounted share successfully.
Is this expected behaviour? If not, how can I fix it? If it is normal, is there some way I can automatically run kinit, when the network comes up? It's connecting via wifi, so the network isn't available immediately on boot, only when a user logs in and unlocks the password keyring.
Thank you for any help.
I have discovered that if I boot my laptop while it's physically plugged in to the network, everything works correctly. I think "pam" is the mechanism that makes it all work without having to manually get a ticket, but it looks like pam doesn't work if I have no network connection at the point of logging in.