Thursday, August 17, 2006

Samba part 2

In the first part about Samba I talked about installing Samba and a way to edit the configuration file smb.conf. In this post I will talk about the steps I took to get it all working. Please note that I am not a linux-expert. So if something works for me it is not guaranteed that it will work for you too.
The first thing I did is add a user to samba. In order to add a user to samba you should first add the user for the server itself. So type
sudo useradd john
now you can add user "john" to samba
sudo smbpasswd -a john
the "-a" parameter means add user. To delete the user type:
sudo smbpasswd -x john
Now that we added the user the only thing left is configure samba. Type:
sudo vi /etc/samba/smb.conf
with editing the existing configuration-file I did not get it working. So decided to start with an empty file and build it from scratch. With some help of examples on the net I ended up with this:

workgroup = MSHOME
server string = %h
security = user
printable = no
read only = no

browseable = no
writable = yes

path = /mnt/music
writable = yes
browsable = yes
This did the trick for me. Now I am able to access the directory "/mnt/music". The only problem I encountered that, although browsable is set to "yes", I was not able to write to this location from my windows client. I found out that this had to do with the permission settings in Unix. You can change these permissions with the command CHMOD. I typed
sudo chmod a=rwx /mnt/music/
now the directory is readable(r), writable(w) and executable(x) for everyone(a). Check here for a very clear tut on the CHMOD command. To start, stop, restart samba type:
sudo /etc/init.d/samba start
sudo /etc/init.d/samba stop
sudo /etc/init.d/samba restart

Next post will be about connecting remotely to the server with "ssh". After that I will post about setting up a DAAP server to serve music to I-tunes with the "(open) digital Audio Access Protocol".

No comments: