windows向Linux共享文件夹(Windows shares folders with Linux)

应用场景:

  1.Linux直接编译windows下的Linux版本代码

  2.虚拟机需要使用大文件,而分配的空间不够

windows准备:

  1.右键共享,共享范围为Evryone,完全控制(控制台输入net share可以查看共享的文件夹爱){可以删除Everyone,然后选择添加,添加你想共享的账户的用户名}

  2.控制面板-》网络共享中心-》启用网络发现,启用文件和打印机共享

Linux准备:

  1.安装cifs-utils,sudo apt install cifs-utils。

  2.安装smbclient ,sudo apt install smbclient 。

  3.只向指定的人共享,smbclient -L 192.168.229.1 -U Linux(参数3为windows有效网卡的ip,或虚拟机(VMware Network Adapter VMnet8)的ip;参数6为用windows登录用户名)

  4.sudo mount -t cifs -o username=Linux //192.168.229.1/Windows /home/xyc/WIndows(参数username为windows的用户名)

  5.步骤4若正确,按照提示输入windows用户登录密码和Linux用户密码。然后查看文件列表,显示共享文件夹成功。

————————

< strong > application scenario: < / strong >

1. Linux directly compiles the Linux version code under windows

2. The virtual machine needs to use large files, but the allocated space is not enough

windows准备:

1. Right click share. The sharing range is everyone. Full control (enter net share on the console to view the shared folder love) {you can delete everyone, and then select Add to add the user name of the account you want to share}

2. Control panel – Network Sharing Center – enable network discovery and enable file and printer sharing

Linux准备:

  1.安装cifs-utils,sudo apt install cifs-utils。

  2.安装smbclient ,sudo apt install smbclient 。

3. Share only to the specified person, smbclient – L 192.168.229.1 – U Linux (parameter 3 is the IP of a valid network card for windows, or the IP of a virtual machine (VMware network adapter VMnet8); parameter 6 is the login user name with windows)

  4.sudo mount -t cifs -o username=Linux //192.168.229.1/Windows /home/xyc/WIndows(参数username为windows的用户名)

5. If step 4 is correct, enter the windows user login password and Linux user password according to the prompt. Then view the file list to show that the shared folder is successful.