Mount windows shared directory on Linux

  

Mount windows shared directory on Linux

1.Share windows folder

Create a password-enabled user before mounting (current user also Yes), and share the folder you want to mount, and give read and write permissions

As shown,


2. Mount the Windows shared directory

Command: mount -t cifs -o username=zhz,password=123456 //10.0.10.1/trunk /data/developer/test

3. Use mount -l to see if the mount was successful. Br>

4. Unmount the shared directory that has been mounted
umount /data/developer/test

Mount the linux folder on Windows

1. Install Samba

2. Create an account
useradd -M -g 500 yourNamesmbpasswd -a yourName

3. Modify the configuration file vim /etc/samba/smb.conf
[yourName]comment = web rootpath = /data/developer/yourName/sharedread only = nopublic = yeswritable = yescreate mask = 0777directory mask = 0777valid users = yourName

4. Restart samba, service smb restart

5. Test if it can be connected
Access in Windows Explorer:\\\\Tester IP\\yourName Purpose: 1. Local and test machine file transfer 2. Native debugging code, linux environment running

Copyright © Windows knowledge All Rights Reserved