Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a problem with Jettison, that tries to remount a samba drive, that is protected by a password.

It uses the following command line:

/sbin/mount_smbfs //[user]@[server]/work /Volumes/work 

Of course it fails since the password is not present (nor the -N switch)

I am aware that it should contain a password, but I do not want the app to know it. So my question is:

Is there a way to request the password like this (I am aware this is not correct):

/sbin/mount_smbfs //[user]: %keychain->[identified keychain]%@<server>/work /Volumes/work 
share|improve this question
    
Which 3rd party tool are you using? –  patrix Oct 24 '12 at 17:38
    
I am investigating on behalf of Jettison (google it). Me and them try to figure a way to remount a samba drive, that fails because of being pass protected. –  SNEILΛ Oct 25 '12 at 6:30
    
You could check out mount_smbfs, assuming that your network shares are smbfs/cifs. mount_smbfs [-N] [-o options] [-d mode] [-f mode] [-h] //[domain;][user[:password]@]server[/share] path I'm not intimately familiar with the OSX startup process, but it's possible you can create your shell-script as a program/folder in /Library/StartupItems or /System/Library/StartupItems source: stackoverflow.com/questions/1142286/… –  konqui Dec 14 '13 at 7:43

1 Answer 1

There is a script able interface to the keychain and it is the security command.

If you are handy with shell scripting or another language and the password doesn't have spaces and odd characters you need to handle, you could follow this tutorial and teach yourself enough to get the password out of the keychain.

So once you've figured out how to pass the password in as a command line argument user:pass you could execute the security command inline or set a temporary variable to hold the value.

share|improve this answer
    
i was aware of the "security" command, but i do not know how to set up a temp variable and add it to the command line. I guess that is more linux related that i can handle. –  SNEILΛ Oct 25 '12 at 6:29

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.