After my switch to mac, I still wanted to access my data stored on my old workstation. I’ve now turn it into a server, for easy access. No point in having all my files on my new mac pro, when I can use my old workstation as a nice file server for me. I had a setup for samba before I started, but it didn’t work well with my mac. Windows system could access the share with no problem at all, but not OS X. There was some re-config to samba needed but no much.
So here goes a quick guide on how I did it, setting up samba, and setting up automount on Mac OS X so that I have instant access to all my files. This is not a very “in-deep” explanation in and around everything just what I had to do to make my samba work with OS X automount.
## Setting up samba
As my server is running Debian, it is fairly and easy task to set up samba.
Simply use APT to install samba.
$>apt-get install samba
After you have done this, you should have a smb.conf file under /etc/samba/
There are many option you can use with samba, to get the full potential out of samba. Go to there website and have a look around.
If you want to use my config file, download it and place it in the /etc/samba folder.
You need to do some small edits, but it should work.
netbios name = Server_name
workgroup = workgroup
server string = Server desc
hosts allow = IP-address, 10.0.0.0/255.255.255.0
Edit these so it fits your network enviroment.
Remember to change the host allow option.
After this has been done we need to add some users. It’s important that the users you want to add to samba already exists on your Linux box. Say you have user called “braindead” already created on your box.
#>smbpasswd -a braindead
New SMB password: *******
Retype new SMB password: *******
Added user braindead
Now you need to add some shares, if you don’t feel like doing this, just use the once that are already created in my config file. But create the directories /mnt/public and /mnt/upload.
(Creating shares are fairly easy, just look at the examples in the config file, you’ll figure it out)
Your samba configure is now complete, and you should have a working Samba Server.
## Setting automounter in Mac OS X
There are quite some ways to do this, but the best way, that I found, was to use NetInfo Manager.
This way your network shares will be automountet every time you login, and if the network share get disconnected it will automatically reconnect to share.
Step by step.
Open up NetInfo Manger.
(You will find it under your utility folder in the application folder or use Key-combo “Shif+Cmd+U”)
Here we need to add a object to the mounts.
Highlight mounts add press the icon in the top that says “New”
You will now have a object called “new_directory” under mounts
Highlight new_directory and add 4 new object using the “New” icon.
You should now edit the 4 object and give them correct property and value(s)
Object1: Property=name, Value=server_ip:/share_point
Object2: Property=dir, Value=/path_to_local_mount_point
Object3: Property=vfstype, Value=url
Object4: Property=opts, Value=url==smb://username:password@server_ip/share_point
It should look something likes this;
Remember that your local mounting point need to exists before setting this up.
When you have done this, you need to save it, and restart your automount.
Open up and a terminal and write.
sudo killall -HUP automount
That’s it. It should now work as a charm.