Thursday, July 3, 2014

Share files Ubuntu 14.04 and Windows 8 with samba.

In this tutorial we will share ubuntu 14.04 folder to windows 8 and windows 8 folder to ubuntu 14.04

The first thing we should do is to install a Samba server on Ubuntu by running the following commands.

sudo apt-get update && apt-get upgrade
then run..

sudo apt-get install samba samba-common system-config-samba winbind

Now let's configure windbind by running the following command.

sudo gedit /etc/nsswitch.conf
in the nsswitch.conf file look for the following line

hosts:  files mdns4_minimal [NOTFOUND=return] dns mdns4
and replace it with this line below.
hosts: files mdns4_minimal [NOTFOUND=return] dns wins mdns4
save the changes and reboot your system

sudo reboot
Set settings on samba by running the ff command:

sudo gedit /etc/samba/smb.conf
then set these following values under your Global Settings but replace the your_host_name_here with your hostname.


[global]
; netbios name = your_host_name_here
name resolve order = bcast host

save the text editor and restart samba

sudo restart smbd
adding samba user:
type samba in the ubuntu unity search box and open it.


















1. click preferences -> samba users -> add user

















2. select your username (in my case my username is dustro) for unix username, put value in windows username (in my case i put winuser) and set password.


3. create shared folder by going to File -> add share
4. set the Directory that you would like to share,  description and the permission check boxes.


5. click the access tab and select the user to have access with your shared folder.
6. click ok. you have now succesfully created a shared folder and a user which has an access to it.


Note: workgroup of both windows and ubuntu should be the same.
To change the workgroup of your linux machine...
1. open samba click Preferences -> server settings -> basic.
    (in my case, my workgroup in my windows machine is "samba" so i put samba as my workgroup in my ubuntu's samba server settings)

restart samba after doing this by running the ff. command.

sudo restart smbd

hmmmm... I think we have done setting up samba in our linux machine so it's now time to test if we can connect to this machine from windows.


No comments:

Post a Comment