1) Check samba and smbfs is installed
sudo apt-get install samba smbfs
It should be...2) Edit the smb.conf file
Edit the file to your needs. Don't forget to make a copy of the original file somewhere just in case something goes terribly wrong.
sudo nano /etc/samba/smb.conf
2a) Tell Samba to allow only known accounts.
Find the following line...
# security = user
Uncomment it and also add an extra line:security = user
username map = /etc/samba/smbusers
Of course, you can tell Samba to point where ever you want it to, just don't forget where.2b) Create Samba user account
Create an account that you will give access to Samba shares
sudo smbpasswd -a name
Add the user to smbuser file and link it to an account on the serversudo nano /etc/samba/smbusers
Once the file is open, add the following line. The "name" will be linked to the name account:name = “name”
Save and exit nano.You have now setup a user for Samba. Now to finish it off - fatality style O_o.
3) Fine tune smb.conf
Now, if you read carefully, the smb.conf file will have a whole load of options. Some are straight forward, some are complex - in the sense that I don't know what would happen if I changed them. Everyone will have different preferences, but these should get you started:
Um...there's too many to list. See Ubuntu Docs, pretty useful.
But, to be helpful, if you want to get started quickly, just add this to the end of the smb.conf file, with your options of course.
[share]
comment = Ubuntu File Server Share
path = /srv/samba/share
browsable = yes
guest ok = no
read only = no
create mask = 0755
4) Restart services
I've also noticed that when doing this, there is some sort of lag in the service restart. So, you may need to wait a little longer before the changed settings will take effect.
sudo restart smbd
sudo restart nmbd
Conclusion
So I think that's it really. I've found that Samba just gives a UI for when accessing server files. It seems to be the same as using SSH and scp to move files to an fro. However, scp can be much faster if you know where you want to put something on the server and you have already set the right permissions. Which brings me to my next point: permissions. Are very important here. Permissions, users and groups. I almost gave myself a headache but I guess so long as you remember what users are in what groups, and which groups can do what. As a general rule, I've written it on stone-tablets in my mind that the user you create when you do a clean install, has admin/root permissions. Therefore, don't use that user name for this kind of stuff. So...if you are having troubles writing to shares once you have mounted them, then my advice is to look up some docs on permissions. Running this:
sudo chmod a+w directory
...may be all that is needed to allow you to do so.Have just re-read this post and...it's longer than Ubuntu Docs :(. Oh well, enjoy!
Extra Places
http://us1.samba.org/samba/docs/man/manpages-3/smb.conf.5.html
No comments:
Post a Comment