實驗01:Samba服務器配置
實驗目標:
掌握samba服務器的配置
實驗步驟:
Samba服務端:
[root@svr5~]# rpm -q samba
package samba isnot installed
[root@svr5~]# yum list samba
..................
Complete!
Samba客戶端:
[root@pc205~]# yum list samba*
Loaded plugins:product-id, refresh-packagekit, security, subscription-manager
This system isnot registered to Red Hat Subscription Management. You can usesubscription-manager to register.
Repositoryrhel-source-beta is listed more than once in the configuration
InstalledPackages
samba-client.x86_64 3.6.9-164.el6
............................
[root@pc205~]# yum -y install samba
..................
Complete!
練習七:配置簡單共享
設置並啓用tools共享
[root@svr5~]# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
[root@svr5~]# vim /etc/samba/smb.conf
[global]
74 workgroup = TARENA//工作組名
security= share//允許匿名訪問共享
289[tools]
290 comment = Test Share Direstory//共享目錄的描述
291 path = /usr/src//指定共享路徑
292 public = yes//所有人都可訪問
293 read only = yes//默認的權限爲只讀
重啓samba服務
[root@svr5~]# service smb restart
\關閉 SMB 服務: [確定]
啓動 SMB 服務: [確定]
練習八:Linux客戶機訪問共享目錄
查詢共享列表:smbclient -L //服務器IP地址
訪問共享目錄:smbclient //服務器IP地址/共享名
mount掛載: mount //服務器IP地址/共享名 掛載點目錄
查詢共享列表
[root@pc205~]# smbclient -L 192.168.4.5
......................
tools Disk Test Share Direstory
IPC$ IPC IPC Service (Samba Server Version3.6.9-164.el6)
.......................
[root@pc205~]# smbclient -L 192.168.4.5/tools
.................
tools Disk Test Share Direstory
IPC$ IPC IPC Service (Samba Server Version3.6.9-164.el6)
.....................
訪問共享目錄(直接掛載)
[root@pc205~]# mkdir /mnt/smbdir
[root@pc205~]# mount -t cifs //192.168.4.5/tools /mnt/smbdir/
Password:
[root@pc205~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda2 ext3 39G 3.6G 33G 10% /
tmpfs tmpfs 495M 224K 495M 1% /dev/shm
/dev/sda1 ext3 194M 30M 155M 17% /boot
/dev/sr0 iso9660 3.6G 3.6G 0 100% /media/RHEL_6.5x86_64 Disc 1
//192.168.4.5/toolscifs 39G 3.5G 34G 10% /mnt/smbdir
問題和經驗總結
故障現象:
samba-client軟件包無法安裝
解決辦法:
查看軟件包是否有依賴的軟件包,如果有的話,先安裝依賴的軟件包,再安裝此軟件包