samba,nfs安裝使用
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#FFCC00;">3、安裝Samba </span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">用以下命令安裝:</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">rpm -ivh samba-3.0.33-3.29.el5_6.2.i386.rpm -f --nodeps</span>
</p>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<div style="margin:0px;padding:0px;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">rpm -ivh samba-client-3.0.33-3.29.el5_6.2.i386.rpm -f --nodeps</span>
</div>
<div style="margin:0px;padding:0px;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">rpm -ivh samba-common-3.0.33-3.29.el5_6.2.i386.rpm -f --nodeps</span>
</div>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">安裝完成後,使用命令</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">rpm -qa | grep samba</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';">進行查詢,發現搭建samba伺服器所依賴的所有伺服器都已經安裝好了即可。</span>
</p>
<p style="margin:10px auto;">
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#FFCC00;">4、配置smb.conf檔案</span>
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">Samba的配置檔案一般就放在</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#33CCCC;">/etc/samba</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';">目錄中,主配置檔名為</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#33CCCC;">smb.conf</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';">,檔案中記錄著大量的規則和共享資訊,所以是samba服務非常重要的核心配置檔案,完成samba伺服器搭建的大部分主要配置都在該檔案中進行。</span>
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">Samba伺服器的工作原理是:客戶端向Samba伺服器發起請求,請求訪問共享目錄,Samba伺服器接收請求,查詢smb.conf檔案,檢視共享目錄是否存在,以及來訪者的訪問許可權,如果來訪者具有相應的許可權,則允許客戶端訪問,最後將訪問過程中系統的資訊以及採集的使用者訪問行為資訊存放在日誌檔案中。</span>
</p>
</div>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<strong style="margin:0px;padding:0px;">第一步:修改配置檔案</strong>
</div>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> 首先備份一下samba的配置檔案</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">cd /etc/samba</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">mv</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;"> smb.conf smb.conf</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">bak</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">然後重新建立一個smb.conf檔案</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#99CC00;">touch smb.conf</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';">然後我們把這段寫入smb.conf中</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">[global]</span>
</p>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">workgroup = LinuxSir</span>
</div>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">netbios name = LinuxSir05</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">server string = Linux Samba Server TestServer</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">security = share</span><br style="margin:0px;padding:0px;" />
<br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">[linuxsir]</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">path = /opt/linuxsir</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">writeable = yes</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">browseable = yes</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';font-size:8pt;"> </span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;">guest ok</span><span style="margin:0px;padding:0px;font-size:8pt;color:#33CCCC;"> = yes</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<br />
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
</p>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> </span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#FFCC00;">註解:</span>
<p style="margin:10px auto;">
<br />
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> </span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#33CCCC;">[global]</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';">這段是全域性配置,是必段寫的。其中有如下的幾行;</span>
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> workgroup 就是Windows中顯示的工作組;在這裡我設定的是LINUXSIR (用大寫);</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> netbios name 就是在Windows中顯示出來的計算機名;</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> server string 就是Samba伺服器說明,可以自己來定義;這個不是什麼重要的;</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> security 這是驗證和登入方式,這裡我們用了share ;驗證方式有好多種,這是其中一種;另外一種常用的是user的驗證方式;如果用share呢,就是不用設定使用者和密碼了;</span>
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> </span><span style="margin:0px;padding:0px;font-family:'Lucida Console';color:#33CCCC;">[linuxsir]</span><span style="margin:0px;padding:0px;font-family:'Lucida Console';"> 這個在Windows中顯示出來是共享的目錄;</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> path = 可以設定要共享的目錄放在哪裡;</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> writeable 是否可寫,這裡我設定為可寫;</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> browseable 是否可以瀏覽,可以;可以瀏覽意味著,我們在工作組下能看到共享資料夾。如果您不想顯示出來,那就設定為 browseable=no</span>
</p>
<p style="margin:10px auto;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> guest ok 匿名使用者以guest身份是登入;</span>
</p>
</div>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> <strong style="margin:0px;padding:0px;">第二步:建立相應目錄並授權;</strong></span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-size:8pt;"> [root@localhost ~]# </span><span style="margin:0px;padding:0px;font-size:8pt;color:#99CC00;">mkdir -p /opt/linuxsir</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<br />
</p>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-size:8pt;"> [root@localhost ~]# </span><span style="margin:0px;padding:0px;font-size:8pt;color:#99CC00;">id nobody</span><br style="margin:0px;padding:0px;" />
<span style="margin:0px;padding:0px;font-family:'Lucida Console';"> </span><span style="margin:0px;padding:0px;font-size:8pt;">uid=99(nobody) gid=99(nobody) groups=99(nobody)</span>
</div>
<span style="margin:0px;padding:0px;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;font-family:'Lucida Console';"> </span><span style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#FFFFFF;font-size:8pt;">[root@localhost ~]# </span><span style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;white-space:normal;background-color:#FFFFFF;font-size:8pt;color:#99CC00;">chown -R nobody:nobody /opt/linuxsir</span><span style="font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;"> </span>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<br />
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;color:#FFCC00;">註釋:</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
關於授權nobody,我們先用id命令檢視了nobody使用者的資訊,發現他的使用者組也是nobody,我們要以這個為準。有些系統nobody使用者組並非是nobody ;
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<strong style="margin:0px;padding:0px;"> </strong><strong style="margin:0px;padding:0px;">第三步:啟動smbd和nmbd伺服器;</strong>
</p>
<div style="margin:0px;padding:0px;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;border-collapse:collapse;font-family:monospace;font-size:12px;line-height:15px;border-spacing:2px;"> </span><span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;">[root@localhost ~]# </span><span style="margin:0px;padding:0px;border-collapse:collapse;line-height:15px;border-spacing:2px;font-family:'Lucida Console';font-size:8pt;color:#99CC00;">smbd</span><span style="margin:0px;padding:0px;border-collapse:collapse;font-family:monospace;font-size:12px;line-height:15px;border-spacing:2px;"><br style="margin:0px;padding:0px;line-height:0.6em;" />
</span>
</div>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<span style="margin:0px;padding:0px;font-family:'Lucida Console';font-size:8pt;">[root@localhost ~]# </span><span style="margin:0px;padding:0px;font-family:'Lucida Console';font-size:8pt;color:#99CC00;">nmbd</span>
</p>
<p style="margin:10px auto;font-family:Verdana, Arial, Helvetica, sans-serif;font-size:14px;line-height:20px;white-space:normal;background-color:#FFFFFF;">
<br />
輸入//地址,然後在windows中就能傳檔案給linux了<br />
<br />
<br />
nfs<br />
<ol>
<li>
檢查包,linux6和5不一樣要注意
</li>
<li>
啟動服務,注意順序service rpcbind restart service nfs start
</li>
<li>
編輯檔案,做好備份 /掛載目錄 掛載方ip /opt 1.1.1.1(rw,sync,no_root_squash)
</li>
<li>
重啟服務 service nfs restart service rpcbind restart
</li>
<li>
待傳方,mount IP/掛載目錄/掛載地址 本地地址 mount 1.1.1.1:/opt /u03
</li>
</ol>
<div>
[root@hrproddb Packages]# rpm -qa |grep nfs<br />
nfs-utils-lib-1.1.5-6.el6.x86_64<br />
nfs4-acl-tools-0.3.3-6.el6.x86_64<br />
nfs-utils-1.2.3-39.el6.x86_64<br />
[root@hrproddb Packages]# rpm -qa |grep rpcbind<br />
rpcbind-0.2.0-11.el6.x86_64<br />
<br />
</div>
</p>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30936525/viewspace-2018572/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Samba安裝與使用Samba
- samba安裝Samba
- samba伺服器安裝Samba伺服器
- FreeBSD安裝samba(轉)Samba
- samba安裝 注意事項Samba
- fedora14 nfs如何安裝?edora14 nfs安裝教程NFS
- Ubuntu16環境安裝和使用NFSUbuntuNFS
- CentOS 7 安裝配置 NFSCentOSNFS
- NFS介紹、NFS服務端安裝配置、NFS配置選項NFS服務端
- samba原始碼安裝及除錯Samba原始碼除錯
- LDAP系列(三)LDAP + Samba 安裝配置LDASamba
- Linux伺服器---安裝sambaLinux伺服器Samba
- ubuntu 22.04 安裝samba服務UbuntuSamba
- nfs伺服器安裝配置NFS伺服器
- heartbeat+drbd+nfs安裝配置NFS
- Centos7 安裝配置NFSCentOSNFS
- CentOS 6 NFS的安裝配置CentOSNFS
- linux服務之NFS和SAMBA服務LinuxNFSSamba
- ubuntu12.04下samba、tftp、nfs的配置UbuntuSambaFTPNFS
- 轉:samba和NFS的區別是什麼?SambaNFS
- Samba伺服器的安裝與配置Samba伺服器
- linux下安裝、配置samba服務LinuxSamba
- Linux伺服器---安裝nfsLinux伺服器NFS
- SUSE 11 NFS server/client 安裝配置NFSServerclient
- Ubuntu 14.04下NFS安裝配置UbuntuNFS
- 11G RAC NFS安裝文件NFS
- ubuntu系統samba服務的安裝配置UbuntuSamba
- linux下Samba服務配置與安裝LinuxSamba
- Samba 安裝與配置 (zt from paipai-oss)SambaAI
- HP-UX SAMBA的安裝及配置(轉)UXSamba
- NFS伺服器的安裝與配置NFS伺服器
- CentOS6.7安裝配置nfs服務CentOSNFS
- Linux下安裝nfs伺服器LinuxNFS伺服器
- samba共享服務安裝,開發可用對映Samba
- Linux 下安裝Samba 檔案共享伺服器LinuxSamba伺服器
- CentOS 5.8 x64 原始碼安裝 samba-3.6.9CentOS原始碼Samba
- CentOS 6.3下Samba伺服器的安裝與配置CentOSSamba伺服器
- 在AIX5.2安裝samba-3.0.4.0.bff出錯AISamba