Samba implements the transfer of Linux and window files

Source: Internet
Author: User

Samba is a free software that implements the SMB protocol on Linux and UNIX systems , consisting of servers and client programs . SMB (Server Messages block, information service blocks) is a kind of communication protocol for sharing files and printers on LAN, which provides shared services of files and printers among different computers in LAN.

Windows transfers files to Linux

01. Create a shared directory on Windows Linux login

Smbclient-l//192.168.1.105-u MVP #查询共享目录

Smbclient//192.168.1.105/share-u MVP #登录共享目录

Mount files on Linux

Mount-o username=mvp,password=89//192.168.1.105/mnt #挂载共享目录到本机

Implement automatic Mount/etc/fstab

Mount-a #刷新挂载点

Linux Transfers files to window

    • Samba
  1. Yun Install-y Samba samba-client #安装Samba
  2. Mkdir/openshare #建立共享文件
  3. Chcon-r-T Samba_share_t/openshare #修改SE上下文
  4. chmod O+w/openshare #更改其他用户写权限
  5. Vim/etc/samba/smb.conf

The configuration is as follows:

[OpenShare]
Path=/openshare #共享路径
Hosts Allow=all #允许所有IP访问
Writable=yes #可写
Browseable=yes #可浏览目录

    • Add Samba Users

Useradd-s/sbin/nologin MVP #添加用户

SMBPASSWD-A MVP #设置samba User password

    1. Systemctl enable SMB; Systemctl start SMB #Samba服务, self-booting
    2. Firewall-cmd--add-service=samba--permanent; Firewall-cmd--reload #添加防火墙
    3. IP a #查看Linux IP

Reference study:

Http://www.linuxidc.com/Linux/2014-12/110459.htm

Http://www.doc88.com/p-2002997665543.html

Samba implements the transfer of Linux and window files

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.