I. Samba Introduction
The purpose of this article is to introduce how to browse the file content in Linux by constructing Samba on a Linux server in windows.
2. Samba installation and configuration
1. Use the yum command to install or update your Samba package.
Yum install samba
Others can be installed by default, but you must first be sure that you can access the Internet, which is very important.
2. view the samba service and restart Samba.
View the samba service running status: # service SMB status
Start the samba service: # service SMB start
Stop Samba service: # service SMB stop
Restart the samba service: #/etc/init. d/SMB restart
You can also set to automatically start the samba service when the system restarts: # chkconfig -- level 345 SMB on
3. Configure the Samba server
(1) create a directory to be shared, such as sudo mkdir/opt/share.
(2) create a user ID for logon, and direct its home directory to/opt/share, sudo adduser -- home/opt/share Login ID
(3) change the directory owner, sudo chown upload ID/opt/share
(4) change the directory permission, sudo chmod -------------------
(5) change the shared ID to a samba user, and set the password according to the prompt.
(6) rewrite the smb. conf file. # Add sudo gedit/etc/samba/smb. conf:
[Global] <br/> workgroup = 17333 # group name <br/> NetBIOS name = Linux server <br/> Server String = chenyl-desktop # name of the displayed computer <br/> Security = user # user indicates that ID and password are required for access, share indicates direct shared access (guest must be enabled) <br/> [Study] <br/> Path =/mnt/share # shared folder path (Home Directory of consumer ID) <br/> Create mask = 0884 # create mask is the permission mask when the user creates a file <br/> directory mask = 0885 # directory mask is the permission mask when the user creates a folder <br /> writeable = yes # file operations, writable <br/> browseable = yes # file operations, browsed <br/> guest OK = No # whether to allow guest logon </P> <p> Valid users = rocket # users or user groups can be added (@ is added before the user group @) <br/>
4. Restart Samba to view the shared directory in windows, as shown in figure 1.
Now, you can view the files in Linux based on the configuration file in windows.
For how to view files in Windows in Linux, you can use the Mount method and the FTP server for transmission. Pay attention to the following points:
(1) many people on the website use the following methods for mounting:
# Smbmount // 10.0.0.10/music/home/user/music-o "username = share, password = yeah"
(2) In fact, there is no smbmount command on Fc. In fact, as early as FC3, it was changed to a cool update method to share files in windows, is "The common Internet File System" (CIFS ). to replace "smbmount", try:
Mount-t cifs // computer name/share/mnt/directory name
(3) Of course, there is also a problem with Chinese path display.
Mount-t cifs // ip/share/Dir-O username = usename, password = xxxx
You can see the Chinese directory with lc_ctype = zh_CN.UTF-8
This article introduces how to configure and use Samba to share files in Linux and Windows.
Appendix: References
1. Step 1 Learn Linux and Windows Shared File Samba (v0.2b) http://www.linuxsir.org/main? Q = node/158
2. Linux and Windows Shared Files: Samba
Http://hi.baidu.com/36470902/blog/item/2e22b482ab89bfb76d8119b2.html
3, virtual machine Linux and host Windows file sharing how: http://zhidao.baidu.com/question/70377695.html
4. How to Access Windows shared folders from Linux after installing Samba: http://www.jb51.net/LINUXjishu/11007.html