Tuesday 2 August, 2011

Share your files in Linux - Windows environment

Samba is the file-sharing protocol used by the Microsoft Windows operating system because some network environments include more than one operating system . If only sharing between Linux and other UNIX variants, it is simply achieved through NFS (Network File System).

First to configure and enable sharing you need to install samba packages.

Ubuntu


sudo apt-get install samba

sudo apt-get install samba-common

sudo apt-get install samba-client

sudo apt-get install smbfs

Note: Any command given below must be run without quotes.

Now Right click on the folder you want to share with Windows-based system, select the “Sharing Option” as below

some_text
Now you will see a sharing option window, here you have to check the “Share this folder” option, to also make the sharing partition writable you must check the “Allow others to create and delete files” option

some_text

For the extra permissions to set you have to click the “Add the permissions automatically” button

some_text
Now you can see a tiny sharing icon above your folder, like this

some_text
Now some admin stuff, press a combination of two keys Alt + F2 a run window will appear, type in here “gksu gedit /etc/samba/smb.conf” and then, click on “Run” button.

some_text
Now here u will see an editor with samba configuration file open. Here you have to add a line with in global ([global]) section “usershare owner only = false”. Save and close the file, now you are done with the configuration.

some_text
Now go to terminal and restart the samba services type

sudo service smbd restart

some_text
Now go to any Windows system within network to check it works, for this go on run prompt (Windows Icon Key + R), type beginning with two back slashes “\\192.168.56.1” , here you have to use your own Unix system IP.

Enter your Unix system user name and password from where you configured the samba and you are done.

To make a network sharing icon in “My Computer” section as a drive icon, run below commands in command prompt (cmd)

Note: After IP name you must give your share folder name.
net use z: \\192.168.56.1\sda7

You can also access the shared folder in Linux system too, the command line way is to type
sudo mount -t cifs //192.168.56.1/sda7/ /mnt/DATA

Where,

/mnt/DATA
is the path where I'm mounting the share folder, to see the content.

CIFS stands for

"Common Internet File System"


You are done, Thankyou..! :-)


No comments:

Post a Comment

Contributors