remounting smb shares

onan

Prescriptivist
I've been trying to set up some non-geek here with easy access to a local smb share. I don't really expect him to remember smb://domain;user:password@sever/share every day; but that shouldn't be a problem, right? I'll just make an alias to the share!

Turns out, not such a good idea. Tried a few different approaches, which all failed differently.

Tried putting it in the Finder toolbar: it prompts him for "domain" and password, then claims it can't find the item. Filesystem not mounted.

Tried reopening a recently-opened Word document on the share: same effect.

Tried putting it in the Dock: clicking on this prompts for "domain" and password, then opens up a Finder window which is titled appropriately as the share, but which displays some (but not all) of the contents of his own hard drive. No new desktop icon, filesystem not really mounted. However, an empty directory is created in /Volumes/sharename. The presence of this directory causes all future mount attempts to fail until rm'd.

Tried making an alias to the share: doubleclicking on this prompts him for "domain" and password _twice_, then claims the service isn't available, then successfully mounts a _different_ point on the server's filesystem.

I don't know what bothers me more: that this fails so miserably, or these these all fail in different ways. They should be doing the same things, especially from a user perspective.

Note that an actual mount through Connect to Server using nasty smb:// url syntax works just fine. The very basic functionality of mounting a filesystem is there, but all of the ancillary stuff is just amazingly broken.

I don't suppose anyone's found a very simple way to mount smb filesystems which actually works? I wouldn't even be above writing an applescript to do it, but I don't see anything which looks applicable in the Finder's dictionary.
 
Originally posted by onan

Tried putting it in the Finder toolbar: it prompts him for "domain" and password, then claims it can't find the item. Filesystem not mounted.


On mine, it claims it can't find the item, but mounts it anyway....
 
I made an alias to my MP3 share on my win2k box.

When I double click the alias, it just asks me for domain, username, and password. Since the Box is a Win2k Box, I just use my Win2k username and password, which is good because it keeps my shares secure from anyone else on the network.

At first, when I made the first alias, I got the "Not found" then mounting problem someone else had, and I solved this by connecting using the alias, trashing that alias, and then creating a new one from the mounted share. I no longer get the error, just the username and password prompt.

I successfully use this share with iTunes. Of course, I have to mount the share via the alias before starting iTunes.

10.1 was the first attempt of embedding samba into the OS. Hopefully Apple's labrats are working on better support for this in 10.2, hopefully we'll be able to nativly share to windows networks without having to install the other part of samba.
 
i would like to be able give smb keychain support... i don't want to log in everytime.

arrgh!!!!
 
it occurs to me, that maybe apple wouldn t be legally allowed to integrate the full samba suite with the OS. samba is GPL and OSX is not. any software that links to GPLed software is required by the license to be GPLed. i might be totally wrong about this. i suspect that the SMB client in 10.1 is not created by the samba project, but rather by apple, for exactly this reason
 
Try this AppleScript:


Open the Script Editor and type:

Code:
tell application Finder
open "smb://<group>;<username>:-<password>@<servername>/-<share>"
end tell


Save it as application.
 
Finder needed to be in quotes. This script still doesn't work though. It now says "Can't get "smb://;:-@/-". Even if I put domain, user, password and share, it still doesn't work.
 
Sorry everybody,

I don't know why the script looks like that in my post. So I attach a screenshot.
 

Attachments

  • smb_script.gif
    smb_script.gif
    3.9 KB · Views: 59
Ok maybe I'm an air-head and this is not obvious to me, but...

How do I create this script? Using what tool? I know it says Apple Script - but... where? how? with what program? I can't seem to find a program called Apple Script anywhere on my hard drive nor on the developer CD I got with my OSX box...

Thanks
 
No problem, the application you need is "Script Editor". It's located in the AppleScript folder inside the Applications folder.

Just open "Script Editor" and type the Code from the screenshot in my second post and replace the variables with your own entrys. Than choose "Save as Application" from the Menu, click "Application" in the "Format" Pop-up field and save the script. That's it.
 
Ok so I am an airhead! :D
Guess I never had a need to look at that before...

BTW it wants Finder to be in quotes so I did that...
But then I tried the code and it keeps telling me "Finder got an error: Can't get " and it lists the code. I tried both with and without the greater than/lesser than codes and with and without the minus signs... and it gives me the same error... :(
 
Originally posted by onan
I've been trying to set up some non-geek here with easy access to a local smb share. I don't really expect him to remember smb://domain;user:password@sever/share every day; but that shouldn't be a problem, right? I'll just make an alias to the share!

Turns out, not such a good idea. Tried a few different approaches, which all failed differently.

Even though you get the error message that it couldn't be mounted, it still DOES mount. Or at least on my machine it does.

I would just create the alias and explain to the user to ignore the error and just click "OK" and then look around on the desktop for the mounted share.
 
I managed to sort this in the following way.

1) mount the share
2) make an alias
3) disconnect
4) double-click on the alias to remount the share
5) get the 'cannot be found message', but share mounts anyway
6) delete the alias
7) make a new alias from the newly mounted share

now it seems to work every time. It does prompt you for your domain and password, but that doesn't bother me too much as our passwords change every couple of months anyway.

It's a bit of a fudge, but it seems to work. I have one of my Docks filled with share aliases.
 
Originally posted by rcakir
Sorry everybody,

I don't know why the script looks like that in my post. So I attach a screenshot.
The problem was that you used < and > to delimit the names to replace. HTML posting is allowed, so it tried to use those tags. You can get around this by using
< Spaces_Between_Brackets_and_words >
or by using a different delimiter:
smb://{foo}{username}{blablah}{Can you tell I don't know the syntax?}

Of course, previewing your post is always a good idea... ;)
 
There is no real reason as far as i can tell why we shouldn't be able to put password info for a SMB share into our keychains.

How lame.
 
Back
Top