Install services in Linux Samba and modify firewall configurations to allow access

Source: Internet
Author: User

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:

 
 
  1. [opt_share]     
  2. path = /opt/share     
  3. public = yes     
  4. writeable = yes     
  5. write list = linux_user    
  6. [opt_share]  
  7. path = /opt/share  
  8. public = yes 
  9. writeable = yes 
  10. 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.

  1. Teach you how to configure Sambauser sharing in Linux
  2. Detailed configuration scheme of linux samba Server Client
  3. Dial-Up users use Linux Samba servers on the LAN
  4. Parsing the configuration file of Linux Samba Server
  5. The most basic commands in the Linux mount command

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.