BIPEDU

my ideas in action

Tag Archives: Samba

samba server on tinycore linux – howto

Simple setup for samba server on Tinycore linux server. Many tutorials are available on internet but mine is tested and it working as I want.

First install samba package on Tinycore linux.

from “tc” user start tce-ab

Then edit the smb.conf file from /usr/local/etc/samba/smb.conf.
Inside add something like this:

[global]
workgroup = WORKGROUP
netbios name = box
security = user

[atom_1t]
comment = Data
path = /mnt/sda1
read only = no
guest ok = no

Explanations:

security = user
this will create a share that is based on user/password

netbios name = box
this will be the name of your server ( alias to avoid tiping the IP address)

read only = no
to have write access

guest ok = no
no allow of guest users ( no anonymous connections)
Then as root you run this command

 smbpasswd -a <tinycore user>

then type the samba password for that user. You will use this password from the client machine when you will connect to the samba share
then save the samba config files to make the changes persistent after reboot.

add in /opt/.filetool.lst

usr/local/etc/samba/smb.conf            <-- this contain samba setup
usr/local/etc/samba/private/passdb.tdb  <-- this contain your password

then backup with “backup”
and then restart the server

Next go at the client machine and in filemanager type:
smb://box/
and you should get a popup window asking for user and password. Put the user and that password you set on samba.

Advertisements

Add right-click Samba share in Thunar/XFCE file manager

Since I use XFCE4 I was searching a easy way to temporarily share a folder to another PC over the network.

Gnome have a nice and easy way of doing this with a right-click on a selected folder.

But for XFCE there is no such option available. But to fix this you have to create a “custom action”.

Note 1: Samba must be installed for this method to work !

Note 2: I tested this solution on Mint 13/XFCE 64bit. It should work also on Ubuntu 12.04 and higher or similar Linux distros.

Step 1:

In Thunar go to Edit–>Configure custom actions…

xfce_samba2

Then add a new custom action:

xfce_samba4

The command is :

net usershare add %n %f “” Everyone:R guest_ok=y

Notice: copy the above command as it is. The shared folder will have the same icon (not like in Gnome with the special “share” folder icon).

Go on “Appearance conditions” tab and there click only on Directory and remove all the others. The main idea is to see this “share” option only if you selected a folder.

xfce_samba5

Step 2:

Create another custom action for removing the folder from Samba share. The steps are similar but the command is :

net usershare delete %n

xfce_samba8

On the “appearance condition” tab select Directory only.

So at the end you should have two custom actions like in the below example:

xfce_samba10

Step 3: test the new created menu.

Select a folder and right-click and select the share menu you just created. In few seconds you should see that folder on your Samba share. Like this:

xfce_samba7

If you are not sure how to access your Samba shares then you have to type “smb://computername/folder/” like in the above image (in to the address bar). If for some reasons it is not working you can try with the IP address of that PC like : smb://192.168.1.5/

The samba shares can be accessed from any Windows/Linux/Mac computer from any file manager like : Explorer, Dolphin, Nautilus, Thunar, Midnight Commander, total Commander, any web browser…etc

To unshare (not share publicly the folder) you have to make right-click on the same folder but choose the second menu with “unshare”. In few seconds the shared folder will not be publicly available.

Tricks :

  • If you need to write from another computer on to the shared folder then you have to give permision to write (chmod) on that shared folder. You can do this directly inside the custom action command like this :

net usershare add %n %f “” Everyone:F guest_ok=y && chmod 777 %f

It is preferable to use for this a empty folder since it may be dangerous to give 777 permission to everyone.

  • The commands described above can also be run in terminal but you have to replace the %n, %f with the correct values. See above pictures for details.