SMB over commandline

hekal

Registered
In 10.1 you can connect to SMB shares by going to the Go menu and clicking Connect to Server.

You enter the information: smb://domainname;user@host/share

Is there a way to do this via command line?
 
I actually don't know, because i don't have 10.1, but since it includes Samba "smbclient" should work, if it doesn't you could compile the source from www.samba.org.

I once did this on OSX and it worked, but I would be careful doing it on 10.1 because it already should have Samba.
 
Maybe you could try
Code:
% [b]open smb://domainname;user@host/share [/b]
You never know...

-Rob
 
I do not see samba on my 10.1 install.

Originally posted by haschka
I actually don't know, because i don't have 10.1, but since it includes Samba "smbclient" should work, if it doesn't you could compile the source from www.samba.org.

I once did this on OSX and it worked, but I would be careful doing it on 10.1 because it already should have Samba.
 
From the command line use the comman 'mount_smbfs'. Type 'man mount_smbfs' to read about it, but the basic syntax is 'mount_smbfs //username@server/share /localdir/somefolder'
You can even fstab it if you want it to load on startup.
 
I haven't had the chance to try this, myself, but I did a top while mounting a Windows drive from the GUI, and I noticed mount_smbfs was used. Anyway, does the Finder recognize the mount when you do it from the command-line? I'd be very interested to write an AppleScript to mount the drive at login, if it did.
 
yes it is recognized in the finder. Create a folder (say /smb/share). then mount_smbfs and point the node to /smb/share . Then in the Finder the folder /smb/share will turn from a folder into an alias with the remote drive icon. That folder or mount point is now the remote server. To unmount it type 'umount /smb/share' and that is the same as ejecting a normally mapped share.
 
There is a commandline utility with os x.1 called smbutil.

The on-line help is a -h example ./smbutil -h
I forgot where I found it but I believe it was in usr/bin

If you are having problems logining on to a samba drive, try
changing your password to all lower case. I found that my present password gave authentication error messages when using my mac.

Mixed case was the root caused, even though I could login from a windows workstation via mixed cased.

Probably an apple samba client bug?!?

-vtoc
 
Back
Top