Virtual machine installation samba
1. The first step is to install samba on linux
sudo apt install samba samba-common
2. Modify the permissions you need to share files
/./works this is share file path/
sudo chmod 777 ./works/
3. Modify the samba configuration file
/open config file*/
sudo vim /etc/samba/smb.conf
最后一行加下面的内容
#for config file,add the following code at the end of the file
[works]
comment = works
path = /home/cody/works
create mask = 0664
directory mask = 0775
public = yes
guest ok = yes
read only = no
browseable = yes
available = yes
writable = yes
4. Restart the samba service
sudo service smbd restart
5. Windows opens the shared folder
PS: The ip address is your current linux ip address.
sudo pdbedit -L -v list current smb database users
sudo pdbedit -a -u root Add a root user to samba
At this point, the virtual machine samba installation is complete
, and then you can use the root user in windows to access samba in the virtual machine
Next is the windows operation
Map Network Drive
Right-click -> This Computer
friendly reminder:
When adding a samba user, do not use the root user directly. It would be better to use your usual user to avoid unnecessary trouble
The link to the configuration file has the function of each line added by the comment. If you need it, you can see
https://download.csdn.net/download/weixin_41903639/86763675