引自百度經驗:配置samba服務器html
完成上述配置以後,共享文件夾將位於絕對路徑/samba。shell
利用形如以下的命令,將但願共享的文件或者文件夾複製到該/samba文件夾,便可從Windows側訪問到:服務器
[tongbo@localhost test]$ sudo cp -r a.txt /samba
複製代碼
[root@localhost samba]# ifconfig -a
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.2.103 netmask 255.255.255.0 broadcast 192.168.2.255
inet6 fe80::1007:645a:b0f2:78dd prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:a7:d8:a7 txqueuelen 1000 (Ethernet)
RX packets 2485 bytes 914380 (892.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1291 bytes 121433 (118.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 68 bytes 5912 (5.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 5912 (5.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:ea:5b:a4 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0-nic: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 52:54:00:ea:5b:a4 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost samba]#
複製代碼
在結果中的ens32中,能夠看到inet 192.168.2.103,便可獲得虛擬機的IP地址。網絡
CentOS 7 桌面 --> 應用程序 --> 系統工具 --> 設置 --> 網絡工具