For linux and windows shared folders, you must first install samba to access linux folders from windows. 1. Configure the shared folder vi/etc/samba/smb. conf example: [filename] path =/filecomment = file browseable = yeswritable = yes www.2cto.com 2 disable Firewall service iptables stop 3 create shared password smbpassword-a user1 ---- now you can access linux file, but there is a security problem,
As long as the user knows the samba account, it is equivalent to knowing a system account. If the password is cracked,
Attackers can attack samba machines. We can use account ing to solve this problem. 4. The account is mapped to/etc/samba/smb. add the following line to the global settings of conf: username map =/etc/samba/smbuserssmbadduser [user1] (account in linux): [user2] (account in windows) */etc/samba/smbuser ing stores the file www.2cto.com. It is very easy to access the Windows folder from Linux, just type the following command. Mount-t smbfs-o username = user, password = password, ip = 192. 168. **. ** // how.achine_name/Tinix/mnt/smb/Tinix where username and password must be valid usernames and passwords on the host and have the permission to access the shared folder Tinix. How.achine_name is the name of the host machine. Note that no space is allowed after the comma.
We do not need to configure the Samba server, because we do not want to access Linux from Windows, we only need
Folder sharing, so that both the host machine and virtual machine can be accessed, and our goal is achieved.
Now, you can see files in Windows in the/mnt/smb/Tinix directory. For example, if there is a shared folder temp on 192.168.1.37, you can mount-t smbfs-o username = guanjun, password = goodguanjun // 192.168.1.37/temp/mnt/cdrom. Author: luckpiky