Added an new user 'share' with password 'share'
adduser share
This also automatically creates a directory /home/share. Added new directories in /home/share to store the data to be shared by samba -
cd /home/share/
mkdir music
mkdir picturesmkdir backups
mkdir videosmkdir /home/share/backups/GiddyKipper
mkdir /home/share/backups/SillySausage
- and changed the owner of the directories to 'share'
chown share:share /home/share -R
Installed samba
apt-get install samba
edited /etc/samba/smb.conf
# Global parameters
server string = Our Fileserver
[global]
workgroup = OURHOUSE
netbios name = fileserver
security = SHARE
#turn off printing!
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes[music]
comment = Shared Music Files
path = /home/share/music
force user = share
force group = share
read only = Yes
guest ok = Yes[pictures]
comment = Shared Pictures
path = /home/share/pictures
force user = share
force group = share
read only = Yes
guest ok = Yes[videos]
comment = Shared videos
path = /home/share/videos
force user = share
force group = share
read only = Yes
guest ok = Yes[backups]
[shares-admin]
comment = Network backups
browseable = No
force user = share
force group = share
read only = Yes
guest ok = Yes
comment = Admin access to the shares
browseable = No
user = share
read only = No
guest ok = No
Added a samba user called 'share' with password 'share'
fileserver:~# smbpasswd -a share
New SMB password:
Retype new SMB password:
Added user share.
And checked he was there OK -
fileserver:~# pdbedit -L
share:1001:,,,
Restarted samba to force rereading of the config file (update: actually don't need to do this - config file is re-read every 60 seconds)
/etc/init.d/samba restart
- and then check to see if shares are exported.
The shares 'music', 'pictures' and 'videos' should be visible to everyone - but no writes or deletes allowed:
The 'backups' share isn't shown above because it isn't browsable - but it's there readonly for everyone as well if you type the full share name in:
Typing in the full path of the 'shares-admin' share brings up a password dialog box and you have to log in as the samba user 'share' as created above before the share is accessable (full read write access):
No comments:
Post a Comment