Samba閰嶇疆涓嶅悓鐢ㄦ埛缁勪笉鍚岀敤鎴风殑璁块棶鏉冮檺

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Samba閰嶇疆涓嶅悓鐢ㄦ埛缁勪笉鍚岀敤鎴风殑璁块棶鏉冮檺相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/%e4%ba%a4%e6%8d%a2' title='浜ゆ崲'>浜ゆ崲   浣跨敤   create   com   rest   pass   win   鏉′欢   

 

1銆侀鍏堟湇鍔″櫒閲囩敤鐢ㄦ埛楠岃瘉鐨勬柟寮忥紝姣忎釜鐢ㄦ埛鍙互璁块棶鑷繁鐨勫涓荤洰褰曪紝骞朵笖鍙湁璇ョ敤鎴疯兘璁块棶瀹夸富鐩綍锛屽苟鍏锋湁瀹屽叏鐨勬潈闄愶紝鑰屽叾浠栦汉涓嶈兘鐪嬪埌浣犵殑瀹夸富鐩綍銆?/p>

2銆佸缓绔嬩竴涓猚aiwu鐨勬枃浠跺す锛屽笇鏈沜aiwu缁勫拰lingdao缁勭殑浜鸿兘鐪嬪埌锛宯etwork02涔熷彲浠ヨ闂紝浣嗗彧鏈塩aiwu01鏈夊啓鐨勬潈闄愩€?/div>
3銆佸缓绔嬩竴涓猯indao鐨勭洰褰曪紝鍙湁棰嗗缁勭殑浜哄彲浠ヨ闂苟璇诲啓锛岃繕鏈塶etwork02涔熷彲浠ヨ闂紝浣嗗浜虹湅涓嶅埌閭d釜鐩綍
4銆佸缓绔嬩竴涓枃浠朵氦鎹㈢洰褰昬xchange锛屾墍鏈変汉閮借兘璇诲啓锛屽寘鎷琯uest鐢ㄦ埛锛屼絾姣忎釜浜轰笉鑳藉垹闄ゅ埆浜虹殑鏂囦欢銆?/div>
5銆佸缓绔嬩竴涓叕鍏辩殑鍙鏂囦欢澶筽ublic锛屾墍鏈変汉鍙杩欎釜鏂囦欢澶圭殑鍐呭銆?/div>
濂斤紝鎴戜滑鍏堟潵鍓嶆湡鐨勫伐浣?/div>
寤虹珛3涓粍锛?/div>
#groupadd caiwu
#groupadd network
#groupadd lingdao
娣诲姞鐢ㄦ埛骞跺姞鍏ョ浉鍏崇殑缁勫綋涓細
#useradd caiwu01 -g caiwu
#useradd caiwu02 -g caiwu
#useradd network01 -g network
#useradd network02 -g network
#useradd lingdao01 -g lingdao
#useradd lingdao02 -g lingdao
鐒跺悗鎴戜滑浣跨敤smbpasswd -a caiwu01鐨勫懡浠や负6涓笎鎴峰垎鍒坊鍔犲埌samba鐢ㄦ埛涓?/div>
#mkdir /home/samba
#mkdir /home/samba/caiwu
#mkdir /home/samba/lingdao
#mkdir /home/samba/exchange
#mkdir /home/samba/public
鎴戜滑涓轰簡閬垮厤楹荤儲鍙互鍦ㄨ繖閲屾妸涓婇潰鎵€鏈夌殑鏂囦欢澶圭殑鏉冮檺閮借缃垚777锛屾垜浠€氳繃samba鐏垫椿鐨勬潈闄愮鐞嗘潵璁剧疆涓婇潰鐨?鐐硅姹傘€?/div>
浠ヤ笅鏄垜鐨剆mb.conf鐨勯厤缃枃浠?/div>
[global]
workgroup = bmit
#鎴戠殑缃戠粶宸ヤ綔缁?/div>
server string = Frank鈥榮 Samba File Server
#鎴戠殑鏈嶅姟鍣ㄥ悕鎻忚堪
security = user
#浣跨敤鐢ㄦ埛楠岃瘉鏈哄埗
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
#浣跨敤鍔犲瘑瀵嗙爜鏈哄埗锛屽湪win95鍜寃innt浣跨敤鐨勬槸鏄庢枃
鍏朵粬鐨勫熀鏈笂鍙互鎸夌収榛樿鐨勬潵銆?/div>
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
#homes娈垫弧瓒崇1鏉′欢
[caiwu]
comment = caiwu
path = /home/samba/caiwu
public = no
valid users = @caiwu,@lingdao,network02
write list = caiwu01
printable = no
#caiwu娈垫弧瓒虫垜浠殑绗?瑕佹眰
[lingdao]
comment = lingdao
path = /home/samba/lingdao
public = no
browseable = no
valid users = @lingdao,network02
printable = no
#lingdao娈佃兘婊¤冻鎴戜滑鐨勭3瑕佹眰
[exchage]
comment = Exchange File Directory
path = /home/samba/exchange
public = yes
writable = yes
#exchange娈靛熀鏈兘婊¤冻鎴戜滑鐨勭4瑕佹眰锛屼絾涓嶈兘婊¤冻姣忎釜浜轰笉鑳藉垹闄ゅ埆浜虹殑鏂囦欢杩欎釜鏉′欢锛屽嵆浣块噷璁剧疆浜唌ask涔熸槸娌$敤锛屽叾瀹炶繖涓潯浠跺彧瑕乽nix璁剧疆涓€涓矘鐫€浣嶅氨琛?/div>
chmod -R 1777 /home/samba/exchange
娉ㄦ剰杩欓噷鏉冮檺鏄?777锛岀被浼肩殑绯荤粺鐩綍/tmp涔熷叿鏈夌浉鍚岀殑鏉冮檺锛岃繖涓潈闄愯兘瀹炵幇姣忎釜浜鸿兘鑷敱鍐欐枃浠讹紝浣嗕笉鑳藉垹闄ゅ埆浜虹殑鏂囦欢杩欎釜瑕佹眰
[public]
comment = Read Only Public
path = /home/samba/public
public = yes
read only = yes
#杩欎釜public娈佃兘婊¤冻鎴戜滑鐨勭5瑕佹眰銆?/div>
鍒版涓烘鎴戜滑鐨勮缃凡缁忚兘瀹炵幇鎴戜滑鐨勫叡浜枃浠惰姹傦紝璁板緱閲嶅惎鏈嶅姟鍝?/div>
#/etc/rc.d/init.d/smb restart
濡傛灉澶у娌℃湁winodws锛屼笉濡ㄥ厛鐢╯amba鐨刢ilent绔懡浠ゆ潵娴嬭瘯涓€涓?/div>
鍛戒护鐨勭敤娉曟垜鍦ㄨ繖閲屽彧涓惧嚑涓緥瀛愶紝鍏蜂綋鐨勫ぇ瀹跺幓璇曢獙
smbclient -L 鏈嶅姟鍣╥p -N
guest甯愭埛鏌ヨ浣犵殑鏈嶅姟鍣ㄧ殑samba鍏变韩鎯呭喌锛屼綘鍙互妫€楠屼竴涓嬫槸鍚ingdao鐩綍鏃跺€欒兘琚玤uest甯愭埛鐪嬪埌锛屽簲璇ユ槸鐪嬩笉鍒扮殑锛屽綋鐒朵綘涔熷彲浠ヤ互鏌愪釜鐢ㄦ埛鐨勫悕涔夋煡鐪?/div>
smbclient -L 鏈嶅姟鍣╥p -U caiwu01
绯荤粺浼氭彁绀哄瘑鐮侊紝鍙杈撳叆smb瀵嗙爜灏辫銆?/div>
smbclient //鏈嶅姟鍣╥p/caiwu -U caiwu01
#浠aiwu01鐢ㄦ埛鐨勫悕涔夌櫥褰昪aiwu鐩綍
smbmount //鏈嶅姟鍣╥p/caiwu /mnt/caiwu -o username=caiwu01
#鎶婃湇鍔″櫒鐨勮储鍔$洰褰曟槧灏勫埌鏈湴鐨?mnt/caiwu鐩綍銆?/div>
娴嬭瘯
smbclient -L //localhost/share銆€鎴栬€呫€€smbclient-L \127.0.0.1 -Umyname銆€//杩欐椂杈撳叆鐨勫瘑鐮佸氨鏄垰鎵嶈缃殑samba瀵嗙爜
浣跨敤
1銆亀indows鐢ㄦ埛
鍦ㄦ垜鐨勭數鑴戝湴鍧€鏍忛噷杈撳叆\192.168.1.1璁块棶锛涗篃鍙痺indows+R杈撳叆\192.168.1.1锛?/div>
鐧诲綍鍚庡彲浠ュ彸鍑绘槧灏勫埌鏈湴椹卞姩鍣ㄣ€?/div>
net use * /delete
2銆乴inux
(1)浣跨敤smbclient
#smbclient//192.168.1.1/Normal -U user%passwd
(2)鎸傝浇鍒版煇涓洰褰曚娇鐢?/div>
#mkdir/mnt/share
#mount -o username=youruser,password=passwd //192.168.1.1/Normal  /mnt/share
璁剧疆寮€鏈烘寕杞藉皢濡備笅鍛戒护鍐欏叆/etc/fstab
//192.168.1.1/share  /mnt/ml45  cifs  defaults,auto,username=youruser,password=passwd 0 0

 

鐒跺悗#mount -a

 

 鍏跺畠妗堜緥锛?a href="https://blog.csdn.net/qq_21419995/article/details/80739003">https://blog.csdn.net/qq_21419995/article/details/80739003

 

以上是关于Samba閰嶇疆涓嶅悓鐢ㄦ埛缁勪笉鍚岀敤鎴风殑璁块棶鏉冮檺的主要内容,如果未能解决你的问题,请参考以下文章

鐢ㄦ埛涓庣敤鎴风粍绠$悊

銆愮粓绔娇鐢ㄣ€戠敤鎴风鐞?鍜?鏌ョ湅鐢ㄦ埛淇℃伅

SuSE涓婅繍琛孧yCat锛堜簩锛夛細閰嶇疆鍗曠偣MyCat

HTML璺宠浆鍒伴〉闈㈡寚瀹氫綅缃殑鍑犵鏂规硶

Go鑾峰彇鐢ㄦ埛缁堢杈撳叆