搭建yum,确保有yum源
Windows与Linux
#下载samba[root@localhost mnt]# yum install -y samba#修改与添加配置文件[root@localhost mnt]# vi /etc/samba/smb.conf# See smb.conf.example for a more detailed config file or# read the smb.conf manpage.# Run 'testparm' to verify the config is correct after# you modified it.[global]workgroup = SAMBAsecurity = userpassdb backend = tdbsamprinting = cupsprintcap name = lpstatprintcap name = /dev/nullload printers = nocups options = rawdisable spoolss =yes[homes]comment = Home Directoriesvalid users = %S, %D%w%Sbrowseable = Noread only = Noinherit acls = Yes[printers]comment = All Printerspath = /var/tmpprintable = Yescreate mask = 0600browseable = No[print$]comment = Printer Driverspath = /var/lib/samba/driverswrite list = @printadmin rootforce group = @printadmincreate mask = 0664directory mask = 0775[share]path = /opt/sharepublic = yeswritable = yes#创建共享目录[root@localhost ~]# mkdir /opt/share[root@localhost ~]# chmod 777 /opt/share/[root@localhost ~]# ll /opt/total 0drwxrwxrwx 2 root root 6 Oct 17 21:17 share[root@localhost ~]# systemctl restart smb[root@localhost ~]# systemctl restart nmb[root@localhost ~]# yum -y install net-tools[root@localhost ~]# netstat -ntlpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN 1461/smbdtcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1461/smbdtcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 897/sshdtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1152/mastertcp6 0 0 :::445 :::* LISTEN 1461/smbdtcp6 0 0 :::139 :::* LISTEN 1461/smbdtcp6 0 0 :::22 :::* LISTEN 897/sshdtcp6 0 0 ::1:25 :::* LISTEN 1152/master#配置用户[root@localhost ~]# smbpasswd -a rootNew SMB password:Retype new SMB password:Added user root.关闭防火墙和selinux去Windows的运行窗口输入\\192.168.200.11修改上传文件在/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: ******
