搭建yum,确保有yum源
    Windows与Linux

    1. #下载samba
    2. [root@localhost mnt]# yum install -y samba
    3. #修改与添加配置文件
    4. [root@localhost mnt]# vi /etc/samba/smb.conf
    5. # See smb.conf.example for a more detailed config file or
    6. # read the smb.conf manpage.
    7. # Run 'testparm' to verify the config is correct after
    8. # you modified it.
    9. [global]
    10. workgroup = SAMBA
    11. security = user
    12. passdb backend = tdbsam
    13. printing = cups
    14. printcap name = lpstat
    15. printcap name = /dev/null
    16. load printers = no
    17. cups options = raw
    18. disable spoolss =yes
    19. [homes]
    20. comment = Home Directories
    21. valid users = %S, %D%w%S
    22. browseable = No
    23. read only = No
    24. inherit acls = Yes
    25. [printers]
    26. comment = All Printers
    27. path = /var/tmp
    28. printable = Yes
    29. create mask = 0600
    30. browseable = No
    31. [print$]
    32. comment = Printer Drivers
    33. path = /var/lib/samba/drivers
    34. write list = @printadmin root
    35. force group = @printadmin
    36. create mask = 0664
    37. directory mask = 0775
    38. [share]
    39. path = /opt/share
    40. public = yes
    41. writable = yes
    42. #创建共享目录
    43. [root@localhost ~]# mkdir /opt/share
    44. [root@localhost ~]# chmod 777 /opt/share/
    45. [root@localhost ~]# ll /opt/
    46. total 0
    47. drwxrwxrwx 2 root root 6 Oct 17 21:17 share
    48. [root@localhost ~]# systemctl restart smb
    49. [root@localhost ~]# systemctl restart nmb
    50. [root@localhost ~]# yum -y install net-tools
    51. [root@localhost ~]# netstat -ntlp
    52. Active Internet connections (only servers)
    53. Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
    54. tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1461/smbd
    55. tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1461/smbd
    56. tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 897/sshd
    57. tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1152/master
    58. tcp6 0 0 :::445 :::* LISTEN 1461/smbd
    59. tcp6 0 0 :::139 :::* LISTEN 1461/smbd
    60. tcp6 0 0 :::22 :::* LISTEN 897/sshd
    61. tcp6 0 0 ::1:25 :::* LISTEN 1152/master
    62. #配置用户
    63. [root@localhost ~]# smbpasswd -a root
    64. New SMB password:
    65. Retype new SMB password:
    66. Added user root.
    67. 关闭防火墙和selinux
    68. Windows的运行窗口输入\\192.168.200.11
    69. 修改上传文件在/opt/share

    Linux与Linux

    #挂载yum,用ftp,第一台安装ftp
    [root@localhost ~]# cd /etc/yum.repos.d/
    [root@localhost yum.repos.d]# ls
    CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo
    CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo
    [root@localhost yum.repos.d]# rm -rf *
    [root@localhost yum.repos.d]# vi local.repo
    [ftp]
    name=ftp
    baseurl=ftp//192.168.200.11/centos
    enabled=1
    gpgcheck=0
    [root@localhost mnt]# yum insatll -y samba-client cifs-utils
    [root@localhost yum.repos.d]# smbclient -L 192.168.200.11 -U root
    Enter SAMBA\root's password: 
    
            Sharename       Type      Comment
            ---------       ----      -------
            print$          Disk      Printer Drivers
            share           Disk      
            IPC$            IPC       IPC Service (Samba 4.7.1)
            root            Disk      Home Directories
    Reconnecting with SMB1 for workgroup listing.
    
            Server               Comment
            ---------            -------
    
            Workgroup            Master
            ---------            -------
            SAMBA                LOCALHOST
    [root@localhost yum.repos.d]# mount -t cifs //192.168.200.11/share /mnt/
    Password for root@//192.168.200.11/share:  ******