How to mount Windows shares in LINUX

 

 

Requirement

There is a share available in Windows server. The user wants to access it's files from a Linux machine.

Windows Pre-requisite

 

Export the Windows folder. Assign a user and password for the associated Windows domain. Inform the Linux admin about these and the Windows domain name. 

Enviromnent for this setup

 

Windows 2008 server
Red Hat Enterprise Linux  6.4

Linux Configuration

 

Create a credential file having Windows username and the password. You could create /root/.secretfile and put below lines in it:

username=user01
password=password01

You will replace the user and password with your actual contents provided by your Windows admin.

Don't forget to set root only permissions for this secret file.

# chmod 600 /root/.secretfile

You are now ready to mount the Windows share. 


Insert one line as shown below into your /etc/fstab:

//hostname/Reports     /opt/Reports2  cifs    credentials=/root/.secretfile,rw,sec=ntlmssp,domain=WORKGROUP,file_mode=0775,dir_mode=0775     0 0

Create a folder /opt/Reports2 or another folder suitable to you.

Replace hostname with your Windows hostname or it's IP address

Replace /opt/Reports2 to be replaced with the mount point that you created.

Replace domain=WORKGROUP with the actual domain that your Windows server is using, usually the default WORKGROUP works.

Ready for the show!

Just mount it now with below command on you rLinux server:

# mount /opt/Reports2

You get the command prompt immediately, and you have done it. Check it:

# cd /opt/Reports2
# ls -l

Bingo! it is showing your Windows file on your Linux machine.

Cheers!

Any issues, send me your comments.


Comments

Popular posts from this blog

Install Puppet Client on RHEL 6.4

Install IBM Tivoli TSM 5.5 Backup Server (trial) on your Laptop using Linux KVM virtual machine

IBM TSM Client 5.x install (trial) on your Laptop using KVM Virtual Machines