Squeezebox Setup

Windows Sharing / Samba

The next thing to get up and running is windows sharing – so that we can start putting data onto the NAS. In Linux windows sharing is provided by the Samba service, so the first thing to do is use yum to install it.

[root@tranquilpc home]# yum install samba
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.sov.uk.goscomb.net
* updates: mirror.sov.uk.goscomb.net
* addons: mirror.sov.uk.goscomb.net
* extras: mirror.sov.uk.goscomb.net
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package samba.i386 0:3.0.33-3.7.el5 set to be updated
--> Processing Dependency: samba-common = 3.0.33-3.7.el5 for package: samba
--> Processing Dependency: perl(Convert::ASN1) for package: samba
--> Running transaction check
---> Package samba-common.i386 0:3.0.33-3.7.el5 set to be updated
---> Package perl-Convert-ASN1.noarch 0:0.20-1.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================
Package Arch Version Repository Size
=========================================================================================================================================================================
Installing:
samba i386 3.0.33-3.7.el5 base 16 M
Installing for dependencies:
perl-Convert-ASN1 noarch 0.20-1.1 base 42 k
samba-common i386 3.0.33-3.7.el5 base 8.7 M

Transaction Summary
=========================================================================================================================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 25 M
Is this ok [y/N]:

If you say yes then samba will be installed. Next we need a functional (i.e. non user) account for samba to use. To create a group use the groupadd command:

[root@tranquilpc etc]# groupadd samba

to create the user use the useradd command

[root@tranquilpc etc]# useradd -c Samba -d /home/samba -g samba -l -s /sbin/nologin -M samba

Next we need to create the home directory (useradd can create the home directory too, but it will apply defaults more suitable to real people accounts).

[root@tranquilpc etc]# cd /home
[root@tranquilpc home]# mkdir samba

Then change the owenership of the directory to the new samba user

[root@tranquilpc home]# chown -R samba:samba samba

Next we need to get Samba configured and switched on. Config wise there are a few options. You could install SWAT, or the Red Hat tool system-config-samba which are in the yum packages samba-swat and system-config-samba. But the config file is pretty straightforwards, so lets just edit that.

The changes that are needed are to add the NAS into your workgroup (almost certainly Workgroup, unless you went out of your way to change it while installing Windows), and to give a name to the server that will appear in the Network Location section of Windows. Samba also has user level security – for a NAS we probably want everyone logging in as a guest user – so this must be configured. We also need to disable printing (otherwise cups errors will fill the logs). Finally we need to set up the main share, and disable (for the time being) printer sharing. Samba also lets you share out user home directories – so individual users can have their own password protected areas. This is also being toggled off (if this sounds like something you want then dont comment out the home section and have a google for smbpasswd).

The settings are in /etc/samba/smb.conf – so open that for editing and for the workgroup config change:

	workgroup = Workgroup
	server string = Storage

	netbios name = STORAGE
        hostname lookups = no

This will give the NAS a name of STORAGE in the Workgroup workgroup. Then for user config add in the guest account and map to guest options (security and passdb dont change):

	security = user
	passdb backend = tdbsam
	guest account = samba
	map to guest = Bad User

Next we’ll change the printing section to:

	load printers = no
	printing = none
	;  cups options = raw
	printcap name = /dev/null
	disable spoolss = yes

To disable all printing stuff. Finally comment out the homes and printers section and add in the main share:

;[homes]
;	comment = Home Directories
;	browseable = no
;	writable = yes
; 	valid users = %S
;	valid users = MYDOMAIN\%S

;[printers]
;	comment = All Printers
;	path = /var/spool/samba
;	browseable = no
;	guest ok = no
;	writable = no
;	printable = yes

[public]
	comment = Public Stuff
	path = /home/samba
	browseable = yes
	guest only = yes
	guest ok = yes
	writable = yes
	public = yes

Finally we need to turn the service on – we could use the ntsysv command again, or just use chkconfig and service:

[root@tranquilpc home]# chkconfig smb on

[root@tranquilpc samba]# service smb start
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]

You should now be able to see the server in windows, and doing Start->Run then entering \\storage should show you one network share called public. You can then map a drive to this in windows explorer.

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: