1

Is it possible to mount a Samba share at logon using a standard OS X logon script, when using an Open LDAP directory for authentication?

Obviously you can get the username from the $1 variable, but can we temporarily capture the password to mount the share?

The share is to be mounted as the user's home directory, which is stored on the Samba share.

To pre-empt the obvious questions:

  • No we can't use Kerberos
  • We do use network account information in the LDAP schema for certain accounts, but can't here for this machine.
  • Yes we have to use Samba, not AFP/NFS
  • Keychain is no use as it is stored in ~/Library, which is in the very directory (~/) that needs to be mounted.

3 Answers 3

0

I understand I'm someway "bypassing" the question, but I'm not sure you have already evaluated alternative approaches.

Alternative approach/suggestion:

  • you can create an alias to the share
  • D&D the alias into the System prefereces -> Accounts -> Login items
  • you can connect and flag the "remember password" option to store it in you login keyring

This way you'll have the share auto-mounted on login, that is what you wanted I hope :)

Note that this is aware of the authentication back-end you use, it is a general solution from this point of view.

Furthermore, I experimented that you can avoid alias creation (that is quite ugly to me) if you can announce your samba share via Bonjour; if it is you can D&D the share without having to create the alias.

1
  • I've edited my question to make it clearer that it is the users home drive that needs to be mounted, so whilst your answer certainly has merit, it won't solve my issue! Aug 31, 2009 at 11:08
0

Is automounting at login time but not being part of the script an option?

You can use AutoFS to automatically mount the share at boot time. Apple has posted a white paper on it: http://images.apple.com/business/docs/Autofs.pdf . I personally haven't actually set one up with these steps however (we use AFP shares and Mac OS X Server which did all the configuration in LDAP for us).

In regards to not being able to use Kerberos from page 24 of the above mentioned white paper:

Since autofs does not mount AFP or SMB shares using Kerberos or individual user credentials, the automounted home shares are unmounted by Login Window and remounted using the user’s credentials from the Login Window. This allows the shares to be mounted with the correct credentials and permissions.

2
  • Sadly this method only works for NFS. You can only use SMB or AFP when using Managed clients via Open Directory. Sep 17, 2009 at 4:28
  • Didn't realize that. Sorry.
    – Chealion
    Sep 17, 2009 at 21:40
0

LDAP (and one day Kerberos) seems to be the only way!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .