Samba configuration-Fedora virtual hard disk mount to host Windows

Source: Internet
Author: User

Installation:

DNF Install Samba

Set up:

Official default configuration: Https://github.com/samba-team/samba/blob/master/examples/smb.conf.default

Config file by default in/etc/samba/smb.conf, my configuration is this:

[Global]  Workgroup = Workgroup  security = User  log file =/var/log/samba/%m.log  passdb backend =  Tdbsam hosts allow = [IP of the virtual network segment, ipconfig in the host] 127.0.0.1 localhost printing = cups printcap name = Cups Load printers = Yes cups options = raw
[Project] Comment = project path =/home/osyo/projects browseable = Yes writable = Yes valid users = osyo Create mask=0770 Force create mode=0770

The last [Preject] is my own shared folder setting, description of folders permission settings: http://linuxcommand.org/lts0070.php

Here is a simple 755-rwxr-x-r-x I set (the file owner can read and write execution, the other members can only reading and execution)

R: Read, W: Write, X: Execute,-(except first): Placeholder

-Represents 0, example r-x = 101 = 5

The location of the three rwx is: File owner, member of the user group, other users

Firewall Open port:

Port used by SMB: tcp:139/445 udp:137/138, system default is firewall

Https://fedoraproject.org/wiki/FirewallD/zh-cn#.E4.BD.BF.E7.94.A8_firewall-cmd

Firewall-cmd--permanent--add-port=139/tcp
Firewall-cmd--permanent--ADD-PORT=137/UDP
...

Restart firewall to view the currently enabled information

Firewall-cmd--list-all

To add a Samba user:

smbpasswd-a [Username]

Note:username must create a Linux user reference for a user that already exists in the system: https://docs.fedoraproject.org/en-US/Fedora/12/html/Deployment_Guide/ S2-users-add.html

To start Samba:

Systemctl start SMB

Confirm that you can connect:

//host /[sharefolder]

Host connections in Windows:

In File Explorer, right-click this computer, add a network location, specify the location of the Web site: \\[virtual machine Ip]\[sharefile]

Set static IP:

Fixed the IP address for easy connection after Windows was established. Because of the GUI, the direct reference to dynamically acquired IP is good ...

Issues:

1. No permission to access file prompts under Windows

Check whether the Eslinux allows shared folders to be open and can be switched off:

Http://www.apelearn.com/study_v2/chapter16.html#id3

or set Eslinux:

Https://fedoraproject.org/wiki/SELinux/samba

Reference:

Http://cn.linux.vbird.org/linux_server/0370samba.php#server_share

Http://www.linuxidc.com/Linux/2011-03/33636.htm

Samba configuration-Fedora virtual hard disk mount to host Windows

Related Article

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.