1. download and install the samba Service
Run the following command under root: Yum install samba
2. Create a shared folder
The shared directory I created is:/Home/Ruby/share and/home/Ruby/Unix
Run the following command:
Mkdir/home/Ruby/share
Mkdir/home/Ruby/Unix
3. Modify the permission of the shared folder
Chmod 777/home/Ruby/share
Chomd 777/home/Ruby/Unix
(In this case, enter ls in the default command line. You can see that the "share Unix" folder turns green)
4. Disable SELinux
Vim/etc/SELinux/config
Set SELinux =EnforcingChange to SELinux =Disable
To disable SELinux:
Modify SELinux = "" in the/etc/SELinux/config file to disabled, and then restart.
If you do not want to restart the system, run the setenforce 0 command.
Note:
Setenforce 1 sets SELinux to enforcing Mode
Setenforce 0 sets SELinux to permissive Mode
5. Configure smb. conf (/etc/samba/smb. conf)
5.1 first find the workgroup field and change its value to Workgroup (because the Working Group name on Windows is workgroup by default)
5.2 find the NetBIOS Name field and give the virtual machine a name.
5.3 add custom shared directory information at the end of the file. For me, I have created two shared directories. My settings are as follows:
[Workspace]
Path =/workspace
Writable = Yes
Public = Yes
Save and exit
6. The two daemon services that enable samba are SMB. Service nmb. Service.
Their functions are as follows:
SMBMain ResponsibilitiesManage what directories, files, and printers are shared by Samba hosts
NmbMainly responsible for group management,NetBIOS NameParsing, etc.
In terms of service management, fedora16 introduces new managementProgram, That is, systemctl. For details, refer to the manual.
Execute Command:
Systemctl start SMB. Service
Systemctl start nmb. Service
TestSambaWhether it can be enabled. If no error message is displayed, it indicates that it can be enabled.
You can run the command systemctl is-enabled SMB. Service nmb. Service to check whether the two services have been enabled successfully.
Execute the followingCodeTo enable the above two services to start automatically
Systemctl Enable SMB. Service nmb. Service
7. Add a samba user and set the password
Note: The user added here must be one of the users in Linux, and my user name is Ruby.
Execute Command:
Smbpasswd-a ruby
Set the password.
8. Disable Firewall
Execute Command:
Iptables-F
9. Restart the Linux Virtual Machine
Reboot
10. win7RunningSecpol. MSC
Select Local Policy->Security Options->Network Security:LanAdministrator Authentication Level
Finally, click the list and select sendLmAndNtmv2, UseNTLMv2Protocol
11.Win7You can find the correspondingSmb. confMediumNetBIOS NameCompleted
Troubleshooting:
1. Whether the firewall has been disabled and SELinux has been disabled
2. Whether the IP address of the virtual machine is in the same network segment as the IP address of the virtual network card of vmware8 in win7
3. Restart the systemctl restart SMB. Service nmb. Service if necessary
4. If the error message "one user name can only be logged on once" is displayed, run the command "net use */del/y" on the win7 command line.