just my personal scrapbook
Configure simple file sharing from KDE4 using samba
Sadly, this functionality is implemented using SUID perl script, and as Archlinux does not support SUID scripts nor it has perl-suid package we will have to get our hands dirty.
- install packages
- configure samba
- modify Template:Codeline scripts
- create C wrapper for Template:Codeline to work as a SUID binary
- configure KDE side of things
- share a folder
Packages we will need:
- Template:Package Official this is the interface we will use to share folders
- Template:Package Official for the server that will share files
- Template:Package Official for System Settings File Sharing part
- Template:Package Official basic KDE workspace (but if you're reading this, chances are you already have it installed)
- Template:Package Official for Template:Codeline (not sure about it, but as of KDE4.4.0 it's still a dependency)
- Template:Package Official to compile SUID wrapper
Install all packages and their dependencies:
Log out and log in again (kdelibs3 are in non standard place and so the
PATH must be updated)
A basic config file works OK, though you'll need to create Samba users (with
smbpasswd -a <user name> as root):
Alternatively you can configure samba with
security = share and add
guest account = <your user name> to get an anonymous Samba server
Remember to add samba to
/etc/rc.conf if you want it to start at boot time.
Create C wrapper
Create such files in your home directory:
compile them using
gcc kde4.c -std=c99 -o kde4 and
gcc kde3.c -std=c99 -o kde3.
Copy them to system folders:
Right click any folder in your home directory and select Properties. Go to Share tab and click 'Configure File Sharing...', you'll be asked for root password.
kcmshell4 fileshare as root)
In the dialog you need to select checkbox near "Enable Local Network File Sharing". Check radiobutton besides 'Advanced sharing', unselect NFS sharing, check 'Simple sharing' again.
Click 'Allowed Users' and select the second option -- 'Only users of a certain group are allowed to share folders'. Click 'Choose group...'. Create new group, call it
samba-share, don't check and checkboxes in the dialog, click OK. In the new window add yourself to the group and all the other users you may want. Click OK.
Click OK in the main dialog.
Log out, log back in.
When the file sharing is configured you will see a new radio button on the Share tab -- Shared and Not shared. Change position to Shared, click OK. On the shared folder should appear now a small globe to indicate that it is shared.