Howto Access / Mount / MAP Windows Share from Linux | RHEL / CentOS 5.x | RHEL / CentOS 6.x | Fedora 17 | Ubuntu 12.10 | Ubuntu 12.04 LTS

Hello,

This Article will show you to Access Windows Shares from Linux. You can Perform this commands to Almost all Linux like ( Red Hat Enterprise Linux, Ubuntu Desktop Edition, Ubuntu Server Edition, CentOS and Of Course Fedora).

This is very basic Howto but this can be very helpful and You can achive this with some simple steps.

Accessing Windows share is called a Mount in Linux Terms. In This Howto and in Section 2 You will able to make that share Permanent available to Linux it is like MAP Drive of Windows from Linux.

Requirements for this Howto :

1. You need to be root to execute this commands, To Access from GUI “root” access is not needed.

2. Package cifs-utils must installed, If its not installed You can Install it by following command

=> For Ubuntu

#sudo apt-get install cifs-utils

=> For RHEL/CentOS

#yum install cifs-utils

Please Perform following steps to Map / Mount / Access windows share directory from Linux

Following topics covered in this article :-

1) Mount Windows Share from Linux ( Temporary ).

2) Mount Windows Share from Linux ( Permanent, Available on re-boot).

3) Accessing Windows Share Directory using Linux GUI.

So Now Let’s Come to the poing and Start Executing Commands

1) Mount Windows Share from Linux ( Temporary ) :-

By Performing this Section you will able to mount windows shared directory from Linux but that will be on Temporary basis once you re-boot your system then it will not available. So Take a note of this.

root@tejasbarot-linux-ahmedabad:~ # mount -t cifs //<windows-ip-address>/<share-name> /<local/mount/point> -o username=username,password=password

For Example :-

root@tejasbarot-linux-ahmedabad:~ # mount -t cifs //192.168.1.3/share /mnt -o username=tejasbarot,password=linuxahmedabad

2) Mount Windows Share from Linux ( Permanent, Available on re-boot).

By Performing this Section you will able to mount windows shared directory from Linux on Permanent Basis, Even if you re-boot then it will be available, But Of-Course Windows share must available.

First of all take backup of /etc/fstab file so if anything goes wrong you can always recover.

=>  To backup /etc/fstab file execute following command.

root@tejasbarot-linux-ahmedabad:~ #cp /etc/fstab /etc/fstab.original

=> Open /etc/fstab with your Favourite text editor. I am using VIM as my editor.

root@tejasbarot-linux-ahmedabad:~ # vim /etc/fstab

=> Now Insert Following entry

//<windows-ip-address>/<share-name> /<local/mount/point> cifs username=username,password=password 0 0

For Example ( Entry Should look like below ) :-

//192.168.1.3/share /mnt cifs username=tejasbarot,password=linuxahmedabad 0 0

Save and Exit from File. To save in VIM ( Press ESC and :wq and ENTER )

=> To Test Your Entry is correct or not Execute following command :-

root@tejasbarot-linux-ahmedabad:~ # mount -a

No Error should be there once you execute this command.

=> Now You can Confirm by “df -h”

3) Accessing Windows Share Directory using Linux GUI.

This is the easiest way to Access Windows Share from Linux.

If You are Using Unity or GNOME 3.0 then you can search for “Connect to Network/Server” and Window will open and If You are using GNOME Classic then You can Perform steps as per below screen shot.

=> Click on “Places” -> Click on “Connect to Network/Server

Connect to Network/Server

Connect to Network/Server

 

=> Select “Windows Share when Next Screen Appears

Select Windows Share

Select Windows Share

=> When Next Screen Comes up,Provide Details of “Windows Share” and click on Connect.

  • Server : IP Address/Name of System where windows share is available (Only this field is required, You can skip all other fields).
  • Port : Provide If only connecting to Non-Default Port.
  • Type: Windows Share
  • Share : Share Name
  • Folder : Folder Inside Share
  • Domain Name : If You are in Domain Environment then Provide Domain Name.
  • Username : Username Who has Share Access
  • Password : Password of User which you have provided above.
Provide Share Details

Provide Share Details

That’s It. By above three methods you can Map / Access / Mount Windows Share from Linux and You can even Make it Permanent same like MAP Drive.

Hope this will helps you, Waiting for your feedback.

If you like this then Please Click Google +1 Button and Show Your Support. Your Support will encourage me to write more articles.

All Linux User’s Blog Mobile Applications :- http://www.tejasbarot.com/download-mobile-apps/

Enjoy Windows Share from Linux :) Enjoy Linux MAP Drive :) Enjoy Linux :) Enjoy Open Source :)

Content Protection by DMCA.com

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.


6 Comments »

 
  • rajnish says:

    Hii Tejas,

    really good article.

    helped a lat.

  • Tejas Barot says:

    Hi Abhishek,

    Most of the people don’t mention basics where i believe in basics first. :-)
    Glad it worked for you and helps you. Keep Visiting Blog.
    Like for more updates http://www.fb.com/AllLinuxUsersBlog

  • Abhishek says:

    Hi,

    Thanks very much. Never knew it would be so easy. Browsed many blogs, articles, forums not one mentioned I had to install cifs utilities.

    The only reason I needed to mount windows share was to do rsync. Linux rules for such cli powerful tools.

  • SImon says:

    Tejas,

    I did not know I had to install CIFS utils until I saw your article (I had installed samba and put the mount command in fstab)- now everything works fine. Thank you so much.

  • Krishnakant Sharma says:

    Tejas,

    What a fantastic Article. Impressed with your article. It’s So much in detail. So much in depth.

    Very well guided again. Thanks for sharing knowledge.

  • Ranvirsinh Sodha says:

    Hello Tejasbhai

    It is very usefull this topic.
    I daily routin windows share from ubuntu,linux,centos is very needed.

    Thanks for your sharing knowledge.

    Good Job. keep it up…..

    Thanks Regard,

    Ranvirsinh Sodha

 

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


four + = 10