Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.
share|improve this question

3 Answers 3

up vote 0 down vote accepted

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

share|improve this answer

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.

share|improve this answer
    
Sadly this method only works for NFS. You can only use SMB or AFP when using Managed clients via Open Directory. –  Jon Rhoades Sep 17 '09 at 4:28
    
Didn't realize that. Sorry. –  Chealion Sep 17 '09 at 21:40

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.

share|improve this answer
    
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! –  Jon Rhoades Aug 31 '09 at 11:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.