Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

gui vs command line connect to smb share (domain vs local)

Go, Connect to Server, "smb://netbiosname;username:password@hostname/share" and connect totally works (or omit the domain;username:password@ and when prompted for name and password, type "netbiosname\username" and the password), but I'm assuming you can only script this with applescript, and I would much prefer normal bash scripting...

...Go, Utilities, Terminal, "mkdir /Volumes/share", then "mount -t smbfs //netbiosname\username:password@hostname/share /Volumes/share" does not work, one gets a "mount_smbfs: server rejected the connection: Authentication error" message.

Note: I can use the mount command without the "netbiosname\" as long as I use a domain name and password, but I'm trying to connect to the machine with a built-in username, thus the username = netbiosname\username. At least for now, I add a domain account to all machines' administrators group (via a group policy to make my life easier!), so I'm scripted, but still curious...

Tried setting the workgroup name to match the target netbios name via the WINS tab/pill in the Advanced button in Network System Preferences (and omit the "domain\" in the call above), but to no avail (and if it did work, wouldn't help me when it comes to multiple machines). Also tried disabling the "Microsoft network server: Digitally sign communications (always)" and "Domain member: Digitally encrypt or sign secure channel data (always)" in the group policy (for the 2008 domain), but to no avail.

Also, tried various mount_smbfs, smbclient, mount -t cifs, and even an .nsmbrc file, but to no avail.

This is for a 10.6 machine connecting to a Windows 7 machine attached to a Windows 2008 (and 2003) domain, but attempting to connect with a local username in the command line (as opposed to GUI working in all circumstances and command-line only working for domain usernames).

Macmini3,1, Mac OS X (10.6.7)

Posted on Mar 28, 2011 10:57 AM

Reply
6 replies

Oct 16, 2011 9:50 AM in response to Hunter3740

I have a question how to unmount the share drive using the command line after using ther open command.

OR how to use the open command "silent mode ???" without poping up the "Finder window"


Because every time I use the open command, it will open up another "Finder" window.


Can anyone help, because I would need to open and close many share drives when needed from the bash script.


Thanks in advance

Jan 4, 2012 9:02 AM in response to hoangfromsan jose

When I do a mount, I use the option -o nobrowse. That doesn't create a link on the desktop and the user never "sees" it. Then I do a umount when I'm done.


I am seeing an issue in Lion in my LogoutHook though. I connect to my domain controllers during the LoginHook and the LogoutHook to copy in a new version of the two hooks (I copy the LogoutHook during login and vice versa). Two simple commands:


mkdir /Volumes/netlogon

mount_smbfs -o nobrowse //username:password@path/netlogon /Volumes/netlogon


I can then do a cp and get the latest version from the DC's. This has worked in 10.4 and 10.5 for sure. I don't have a 10.6 box to see if that's working or not. But it is definitely broken in 10.7.2. The mkdir works, but the mount gives me:


mount_smbfs: server rejected the connection: authenication error


Very strange...

Mike

gui vs command line connect to smb share (domain vs local)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.