27 Aralık 2012 Perşembe

300. Briefly: Sharing a folder using SAMBA on Debian

To contact us Click HERE
I don't ever use samba, but it's not a bad thing to know how to set up in case you need to share files with someone using Windows in a pinch.

First install samba:
sudo apt-get install samba samba-common smbclient

To get a share up with samba, create an /etc/samba/smb.conf and stick the following in it:

[global]workgroup=WORKGROUPguest account=nobodysecurity=shared
netbios name=
[asharedfolder]path=/home/lindqvist/sharedguest ok=yesread only=nowritable=yesbrowsable=yescomment= SMB share

Restart samba:
sudo service samba restart

1. This is an insecure share i.e. <b>anyone can access it</> and edit everything.
2.. Also, by leaving netbios name= blank you can use the IP address of the server as the hostname, but you could also call it e.g. niobium and use that as the hostname in nautilus when you connect to the host server.

To set up a user- and password-based share, do
[global]workgroup=WORKGROUPsecurity=user
netbios name=
[asharedfolder]path=/home/linqvist/sharedguest ok=noread only=nowritable=yesbrowsable=yescomment= SMB share

You need to add and set the samba password, and enable the linux user you want to give access as well:
sudo smbpasswd -L -a -e lindqvist


There are a lot of other options that can be set. Two of the more interesting ones are probably
[asharedfolder]createmask=0755valid users=me myself irene

which means that any new files created in that share via samba gets chmod 755, and only the users me, myself and irene can connect.

But often a basic smb.conf is easier to manage and will do what you want it to.

Hiç yorum yok:

Yorum Gönder