Linux Samba has been widely used but is constantly updated. Here we will introduce how to install and use Linux Samba to help you install and update the Linux Samba system. This document uses Fedora 12 as an example to describe how to configure Linux Samba to share files between Linux and Windows systems.
Install Linux Samb
1. run the following command to check whether Linux Samba and samba-clientyum info samba-client have been Installed. If so, Installed Packages is displayed on the first line of command output. If Available Packages is displayed, it indicates that no installation is available. Please continue the step-by-step installation.
2. run the following command to install (use root user or use sudo) yum install samba-client to Access Windows Shared samba-client from Fedora to provide support for the mount command on the CIFS file system, including Windows sharing. If you only want to temporarily access a Windows share, you can manually run the following command root user or sudo to mount Windows share (Suppose we want to access the win_share directory on 192.168.1.2, the username and password are respectively username and password. They must be mounted to the/mnt/win_share directory, and the owner is linux user linux_user.): mount-t cifs-o uid = linux_user, user = username, password = password // 192.168.1.2/win_share/mnt/win_share if you need to use this share for a long time, add the following content to/etc/fstab, in this way, the system will automatically mount the shared directory: // 192.168.1.2/win_share/mnt/win_share cifs uid = linux_user, user = username, password = password 0 0
For more options, see the man page of mount. cifs: man mount. cifs
Access Fedora sharing from Windows. Suppose we want to access the/opt/share directory (share Name: opt_share) on Windows using linux_user and read/write mode from Windows with 192.168.oraip 192.168.1.3.
1. Edit the/etc/smb. conf file.
In the [global] section, set the Window Working Group name workgroup = Group_Name and add the following content at the end of the file:
- [opt_share]
- path = /opt/share
- public = yes
- writeable = yes
- write list = linux_user
- [opt_share]
- path = /opt/share
- public = yes
- writeable = yes
- write list = linux_user
Note: The/opt/share directory must be writable to linux_user.
2. Add the corresponding Linux Samba user to linux_user and set the password:
Sudo smbpasswd-a linux_user
3. Start the Linux Samba service
Sudo/etc/init. d/smb start:
Sudo/sbin/chkconfig -- level 35 smb on
4. Modify the firewall configuration to allow Linux Samba access
Run sudo system-config-firewall. On the Trusted Services configuration page that appears, select Linux Samba and Samba Client, and Apply
5. Modify SELinux settings
If SELinux is enabled, the above configuration can only be accessed in read-only mode. You need to modify SELinux settings:
Sudo chcon-t samba_share_t/opt/share
6. Use linux_user and the password you just set to access \ 192.168.1.3 \ opt_share on Windows machines.
- Teach you how to configure Sambauser sharing in Linux
- Detailed configuration scheme of linux samba Server Client
- Dial-Up users use Linux Samba servers on the LAN
- Parsing the configuration file of Linux Samba Server
- The most basic commands in the Linux mount command