Senin, 08 Agustus 2016

How To Mountain Windows Portion To Linux Auto Using Cifs

Introduction :-

This is the blog, How to mountain Windows Share to Linux machine permanently using CIFS. 

For an Administrator, it is required many times to mountain Windows part into Linux Server, It could live on due to merely about backup or re-create information from Linux machine to Windows machine.

Requirement :-

We ask 2 working PC :
1- Windows PC where part needs to create.

2- Linux PC where part needs to Mount.

Configuration Steps :- 

1- Windows Machine side configuration :- 

1 A- Create a shared folder too assign permission to a user using below steps :

- Create a folder cite website in whatsoever drive 
-  go to properties 
Select Share TAB 
Click on Advanced Sharing button 
- Select the Check box Share this folder 
- Select permission button 
- Click On ADD 
- Enter User Name whom you lot desire to give permission -
- Select Full Control banking concern gibe box 
- click on Apply and OK

Note- The Same User Name too it's password, We volition purpose to Mound this folder into Linux machine.


2- Linux Machine side configuration :-

We ask to install the next package 

1- CIFS-UTILS
2- samba-client samba-common

2 A- Install cifs-utils using command yum install.


[root@testsvn  ]# yum install cifs-utils 

Check install package using command rpm -qa

[root@testsvn  ]# rpm -qa | grep cifs cifs-utils-4.8.1-20.el6.x86_64 [root@testsvn  ]# 

In to a higher house inquiry cifs 4.8 bundle larn installed.

2 B - Install samba-cifs too samba-common bundle using yum command

[root@testsvn  ]# yum install samba-client samba-common 

Check install package using command rpm -qa

[root@testsvn  ]# rpm -qa | grep samba samba-client-3.6.23-35.el6_8.x86_64 samba-common-3.6.23-35.el6_8.x86_64 samba-winbind-3.6.23-35.el6_8.x86_64 samba-winbind-clients-3.6.23-35.el6_8.x86_64 [root@testsvn  ]# 

In to a higher house inquiry samba-client, samba-common, samba-winbind and samba-winbind-clients bundle would live on available.

2 C - Now practise credentials file, too add together user, password detail

[root@testsvn  ]# vi .smbcredentials 

username=User_Name                    This user would live on same whom nosotros give permission on shared folder.
password=User_Password

Save and Exit  from file.

Note-  if you lot are sharing folder on a PC fellow member of Domain controller hence purpose this format for the user - Domain_Name\User_name.

2 D- Now alter credentials file permission -

[root@testsvn  ]# chown beginning .smbcredentials                  To brand beginning possessor of this file [root@testsvn  ]# chmod 600 .smbcredentials                   To Give beginning user RW permisson  


2 E- Create mountain directory too FSTAB entry to add together this mountain permanently -

Create a mountain directory - 
[root@testsvn  ]# mkdir /mnt/winshare 

Let's exam access on part folder using mountain command
[root@testsvn  ]# mount -t cifs -o credentials=/root/.smbcredentials //10.0.1.13/websites /mnt/winshare

In to a higher house event item equally follow:

mount                                       =   command
-t cifs                                         =  where t is type too Cifs is filesystem
-o                                                =  where -o is option
credentials                              =  command to define credentials path
/root/.smbcredentials        =  This path comprise User_Name too Password
//10.0.1.13/websites           =   Windows Share path
/mnt/winshare                     =  Linux PC mounting directory

Let's banking concern gibe mounting using mount command -

[root@testsvn  ]# mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) //10.0.1.13/websites on /mnt/winshare type cifs (rw) [root@testsvn  ]# 

Windows Share folder accept been mounted successfully !!!!

Let's Make FSTAB entry to mountain permanently 

[root@testsvn  ]# vi /etc/fstab 
 Append below business into this file.
//10.0.1.13/websites /mnt/winshare cifs  credentials=/root/.smbcredentials,uid=1000,gid=1000
Save too Exit from file. 
Now you lot fstab file looks similar below :
/etc/fstab # Created past times anaconda on Tue February  2 12:30:07 2016 # # Accessible filesystems, past times reference, are maintained nether '/dev/disk' # See homo pages fstab(5), findfs(8), mount(8) and/or blkid(8) for to a greater extent than information # /dev/mapper/VolGroup-lv_root /                       ext4    defaults        1 1 UUID=3291b0ee-d2d5-44eb-9418-d2b81c72ea8e /boot                   ext4    defaults        1 2 /dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0 tmpfs                   /dev/shm                tmpfs   defaults        0 0 devpts                  /dev/pts                devpts  gid=5,mode=620  0 0 sysfs                   /sys                    sysfs   defaults        0 0 proc                    /proc                   proc    defaults        0 0 //10.0.1.13/websites    /mnt/winshare   cifs  credentials=/root/.smbcredentials,uid=1000,gid=1000  
Run command mountain -a to refresh entry.
[root@testsvn  ]# mount -a
3 - Let's banking concern gibe mounted folder-
Go to mount directory
[root@testsvn  ]# cd /mnt/winshare/ 
Create test dir using mkdir command
[root@testsvn winshare]# mkdir test
Now become to Windows PC and banking concern gibe test folder would live on there.













We accept successfully mounted Windows part folder to Linux machine.




That's All
!!!Cheers!!!

Sumber https://linuxhowtoguide.blogspot.com/

Tidak ada komentar:

Posting Komentar