Linux虛擬機配置/訪問samba服務器

1 配置samba服務器

引自百度經驗:配置samba服務器html

完成上述配置以後,共享文件夾將位於絕對路徑/sambashell

利用形如以下的命令,將但願共享的文件或者文件夾複製到該/samba文件夾,便可從Windows側訪問到:服務器

[tongbo@localhost test]$ sudo cp -r a.txt /samba
複製代碼

2 在Windows側訪問samba共享文件夾

2.1 查看虛擬機IP地址

  • 終端輸入ifconfig -a命令
[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 桌面 --> 應用程序 --> 系統工具 --> 設置 --> 網絡工具

2.2 Windows查看samba共享文件夾

  • 打開資源管理器,以下圖輸入\\192.168.?.?
訪問samba共享文件夾
  • 登陸samba用戶,注意這裏登陸的是配置samba服務器時的用戶
登陸samba帳戶
  • 操做文件夾數據
操做samba共享文件夾數據
相關文章
相關標籤/搜索