Samba
1支持软件包
samba-2.2.7a-7.9.0.i386.rpm
samba-client-2.2.7a-7.9.0.i386.rpm
# rpm -qa samba
samba-2.2.7a-7.9.0
# rpm -qa samba-client
samba-client-2.2.7a-7.9.0
2配置文件目录
#cd /etc/samba
#vi smb.conf
采用默认设置,允许与主机用户同名的smb用户访问主机用户
3添加SMB用户
3.1添加系统用户,是开启本地用户。
# useradd smbtest
# passwd smbtest
Changing password for user smbtest.
New password:
BAD PASSWORD: it is too simplistic/systematic
Retype new password:
passwd: all authentication tokens updated successfully.
3.2既是把smbtest用户开启smb用户权限
[root@testbed samba]# smbpasswd -a smbtest
New SMB password:
Retype new SMB password:
Added user smbtest.
4开启smb服务
#service smb [restart|stop|start|status]
# service smb restart
关闭 SMB 服务: [ 确定 ]
关闭 NMB 服务: [ 确定 ]
启动 SMB 服务: [ 确定 ]
启动 NMB 服务: [ 确定 ]
# service smb status
smbd (pid 4951) 正在运行...
nmbd (pid 4955) 正在运行...
5本机客户端测试
命令格式:
列出主机共享资源表:# smbclient -L//主机名或主机IP -U //smb用户名
使用共享资源:#smbclient -L//主机名或主机IP/共享目录名 -U //smb用户名
下面的localhost是服务器 smbtest是主机 共享的文件夹在/home/snbtest下 是服务器提供的。
[root@testbed samba]# smbclient -L localhost -U smbtest 查看本机的资源既是服务
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba Server)
ADMIN$ Disk IPC Service (Samba Server)
smbtest Disk Home Directories
Server Comment
--------- -------
TESTBED Samba Server
Workgroup Master
--------- -------
MYGROUP
在服务器下/home/smbtest下建立一个文件test
[root@testbed samba]# smbclient //localhost/smbtest -U smbtest
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
smb: \> dir
. D 0 Thu Apr 19 13:58:01 2007
.. D 0 Thu Apr 19 13:42:37 2007
.kde DH 0 Thu Apr 19 13:42:37 2007
.bash_logout H 24 Thu Apr 19 13:42:37 2007
.bash_profile H 191 Thu Apr 19 13:42:37 2007
.bashrc H 124 Thu Apr 19 13:42:37 2007
.emacs H 847 Thu Apr 19 13:42:37 2007
.gtkrc H 120 Thu Apr 19 13:42:37 2007
test 8 Thu Apr 19 13:58:01 2007
39469 blocks of size 262144. 20520 blocks available
smb: \> quit
6Windows端的测试
6.1在”网上邻居”中的”Mygroup”工作组中就可查看Linux下安装的smb服务器
6.2直接在”运行”中输入”\\服务器名或\\服务器IP地址”
6.3 \\服务器IP地址 -U (smb用户名)
7Linux主机上访问smb资源
命令格式:
smbmount 共享资源地址 加载点 -o 参数
smbumount 加载点
[root@testbed samba]# mkdir /mnt/smb
[root@testbed samba]# smbmount //128.100.3.141/smbtest /mnt/smb -o username=smbtest
Password:
[root@testbed samba]# ls /mnt/smb
test
[root@testbed samba]# smbumount /mnt/smb
[root@testbed samba]# ls /mnt/smb
8特定用户访问的共享目录
[root@testbed root]# useradd fred
[root@testbed root]# passwd fred
Changing password for user fred.
New password:
BAD PASSWORD: it is too short
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testbed root]# smbpasswd -a fred
New SMB password:
Retype new SMB password:
Added user fred.
[root@testbed root]# mkdir /var/samba/fred
mkdir: 无法创建目录‘/var/samba/fred’: 没有那个文件或目录
[root@testbed root]# mkdir /var/samba
[root@testbed root]# mkdir /var/samba/fred
[root@testbed root]# echo "test fred">/var/samba/fred/test
[root@testbed root]# vi /etc/samba/smb.conf
[fredsdir]
comment=This is Fred's SMB share folder
path=/var/samba/fred
valid users =fred #<添加多个用户名可支持多用户访问>
public = no
writable=yes
[root@testbed root]# sercice smb restart
[root@testbed root]# smbclient //128.100.3.141/fredsdir -U fred
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
smb: \> dir
. D 0 Thu Apr 19 15:02:59 2007
.. D 0 Thu Apr 19 15:02:34 2007
test 10 Thu Apr 19 15:02:59 2007
39469 blocks of size 262144. 20524 blocks available
smb: \> quit
[root@testbed root]# smbclient //128.100.3.141/fredsdir -U lxf
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
tree connect failed: NT_STATUS_WRONG_PASSWORD
[root@testbed root]# smbclient //128.100.3.141/fredsdir -U smbtest
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
tree connect failed: NT_STATUS_WRONG_PASSWORD
9用户组访问的目录
[root@testbed root]# useradd staff
[root@testbed root]# passwd staff
Changing password for user staff.
New password:
BAD PASSWORD: it is too short
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testbed root]# useradd -G staff user1
[root@testbed root]# passwd user1
Changing password for user user1.
New password:
BAD PASSWORD: it is too short
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testbed root]# useradd -G staff user2
[root@testbed root]# passwd user2
Changing password for user user2.
New password:
BAD PASSWORD: it is too short
Retype new password:
passwd: all authentication tokens updated successfully.
[root@testbed root]# smbpasswd -a user1
New SMB password:
Retype new SMB password:
Added user user1.
[root@testbed root]# smbpasswd -a user2
New SMB password:
Retype new SMB password:
Added user user2.
[root@testbed root]# mkdir /var/samba/staff
[root@testbed root]# chmod 770 /var/samba/staff
[root@testbed root]# chown staff.staff /var/samba/staff
[staff]
comment=This is staff
path=/var/samba/staff
public=yes
writable=yes
read list=@staff
write list=@staff
[root@testbed root]# service smb restart
测试
[root@testbed root]# smbclient -L //128.100.3.141 -U user1
...
[root@testbed root]# smbclient -L //128.100.3.141 -U user2
...
[root@testbed root]# smbclient //128.100.3.141/staff -U user2
added interface ip=128.100.3.141 bcast=128.100.3.255 nmask=255.255.255.0
Password:
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.2.7a]
smb: \> dir
. D 0 Thu Apr 19 15:21:42 2007
.. D 0 Thu Apr 19 15:21:42 2007
39469 blocks of size 262144. 20523 blocks available
smb: \> ?
? altname archive blocksize cancel
cd chmod chown del dir
du exit get help history
lcd link lowercase ls mask
md mget mkdir more mput
newer open print printmode prompt
put pwd q queue quit
rd recurse rename rm rmdir
setmode symlink tar tarmode translate
!
smb: \> mkdir test
smb: \> ls
. D 0 Thu Apr 19 15:45:09 2007
.. D 0 Thu Apr 19 15:21:42 2007
test D 0 Thu Apr 19 15:45:09 2007
39469 blocks of size 262144. 20523 blocks available
smb: \> quit


190.38.56.* 于 2007-06-12 03:07:03发表:
276b6eeba5cede6403001a625eb497f9 http://camera-commercio-roma-prontuario-diritto-bollo.uoyrgt.org/ http://30-dicembre-1971-n-1204.fkgkox.org/ http://cerco-donna-cerca-uomo-scopare.uoyrgt.org/ http://auricolare-blue-tooth-bf400-sbs.ljiwrk.org/ http://soluzione-compagnia-dell-anello-pc.cckzfi.org/ http://locale-dove-fare-sesso-maastricht.uoyrgt.org/ http://anticipazioni-su-un-paso-adelante.ljiwrk.org/ http://art-474-c-p-regolarizzazione-straniero.cckzfi.org/ http://tassa-possesso-auto-metano-finaziaria-2007.cckzfi.org/ http://vitamina-b12-acido-folico-diminuisce-celiachia.uoyrgt.org/ 3ebbdc0c5c788c89d957115fc277340d
81.220.58.* 于 2007-06-11 03:10:28发表:
3c4e6112e37ca39e864ce35f73ab757a http://vendita-videocamera-canon-xl2-germania.kfxrfs.net.in/ http://orologio-maschile-polso-dolce-gabbana.dtifhu.net.in/ http://sesso-tra-moglie-e-marito.hhknox.net.in/ http://elaborato-scritti-ambiente-alunni-elementare.oaxzml.net.in/ http://dibattito-autenticita-diario-anna-frank.ooqqld.net.in/ http://cateteri-venosi-centrale-assistenza-infermieristica.kfxrfs.net.in/ http://dopo-aver-tolto-parati-applicare.ooqqld.net.in/ http://dichiarazione-iva-ridotta-al-10.hhknox.net.in/ http://presentazione-giro-d-italia-2007.kfxrfs.net.in/ http://cercasi-lavoro-san-dona-piave.oaxzml.net.in/ 319dbbb4ab069a1bfb4a4d4d12c61dcd
85.136.170.* 于 2007-06-09 02:59:02发表:
eaa7fc2b7564af29d776d54d9be3d9eb http://donna-moderna-6-luglio-2006.mbxbva.org/ http://hotel-sant-agata-dei-due-golfo.hwqegr.org/ http://la-bella-e-la-bestia-musica.mbxbva.org/ http://fondiaria-sai-assicurazione-sede-legale.lbpwqo.org/ http://scheda-libro-qui-pro-quo-bompiani.lbpwqo.org/ http://d-p-r-1026-76-testo.hwqegr.org/ http://yahoo-messenger-versione-2-0-download.mbxbva.org/ http://parco-regionale-regione-campania-elenco-comune.hwqegr.org/ http://natalia-corpo-ballo-buona-domenica.qjgasd.org/ http://come-creare-una-gif-animata.akermn.org/ e44c2d91c99facb894d3b26e91151560
190.75.171.* 于 2007-06-08 04:38:57发表:
6e7b6bd2046528c968dd83385a01124f http://banca-del-del-lavoro-it.lykglu.org/ http://case-in-affitto-a-pavia.yixkrt.org/ http://pepata-cozza-all-aceto-balsamico.bzeitz.org/ http://albergo-san-quirico-d-orcia.fjhozm.org/ http://gruppo-musicale-italiano-rovescio-medaglia.zouvtz.org/ http://percorso-sicuro-casa-scuola-bibliografia.zouvtz.org/ http://riforma-titolo-v-costituzione-turismo.kkwhbs.org/ http://divorzio-cubano-tramite-ambasciata-italia.ivrfxb.org/ http://date-spettacolo-aldo-giovanni-giacomo.rpddkk.org/ http://foto-donna-matura-uomo-maturo.tpfcwv.org/ 2e2f8656ca7971267ae7180fc612fe21
201.208.125.* 于 2007-06-07 07:18:20发表:
bc73b9cbdecd4b9b048663e4742fcd0f http://notizia-mondiale-pattinaggio-rotella-2006-spagna.gjtkci.info/ http://lesioni-personale-medicina-legale-powerpoint.urajxu.info/ http://latte-polvere-polilat-mellin-350-gr.hwqovr.info/ http://lo-stipendio-di-un-quadro.hwqovr.info/ http://guerra-dei-sette-anno-storia-militare.rwikgt.info/ http://scaricare-gioco-educativo-didattico-bambino.alflim.info/ http://istat-prezzo-affitto-2005-6.urajxu.info/ http://fedelta-dio-fedelta-dell-uomo.alflim.info/ http://fac-simile-parere-revisori-assestamento.ciymwb.info/ http://romania-commercio-metallo-non-ferroso.alflim.info/ 6dea66dd0952ca77d762129bda0df247
201.209.17.* 于 2007-06-06 10:22:32发表:
d032017e52e3a181c7870e1a38a056be http://vettura-si-possono-immatricolare-autocarro.duajwe.info/ http://centro-assistenza-elettrodomestico-franke-provincia-pavia.jknrtq.info/ http://ragazzo-down-picchiato-classe-compagni.duajwe.info/ http://produci-and-consuma-and-crepa.duajwe.info/ http://scarpa-gola-donna-nera-pelle.yyunae.info/ http://episodio-telefilm-posto-al-sole.yyunae.info/ http://non-voglio-perderti-gianluca-capozzi.yyunae.info/ http://ccnl-vetro-industria-29-novembre-2002.yyunae.info/ http://unica-tariffa-chiamate-internazionale-internet.qirjux.info/ http://talpa-can-5-nuova-edizione.jknrtq.info/ 11bac96dbb32ab2fd1a6f4018c996a56
190.48.46.* 于 2007-06-05 15:22:32发表:
3b233ca0711e110af834fad09a2a7d46 http://orario-dei-mezzo-cotral-monterotondo.kbucdn.info/ http://pit-bull-autotreno.fwpjkf.info/ http://mobilificio-mobilia.fwpjkf.info/ http://lombardia-macchina-radiocomandate-motore-scoppio.fwpjkf.info/ http://termus-acca-crack.dhvvfi.info/ http://bruciatore-incenso.fwpjkf.info/ http://giannini-minerale-elba.wkermn.info/ http://host-uniroma3-it-studente-caaf.kbucdn.info/ http://sbocco-telefonico-tre-lg-u8120.fwpjkf.info/ http://bravo-ragazzo-levanto.wkermn.info/ 4080af707aca2bbb96231fb1b4743d28
201.225.51.* 于 2007-06-04 20:47:52发表:
768e61e217de32842c917a2715229836 http://ordine-degli-avvocati-di-catania.divuvu.org/ http://annuncio-casa-vacanza-in-sardegna.vprmbs.org/ http://mattia-martorano-concerto-dicembre-2006.vprmbs.org/ http://modifiche-jeep-posto-7-language-it.dlmpxx.org/ http://cercasi-lavoro-agenzia-viaggio-torino.xcwjal.org/ http://adattatore-video-media-player-video-ipod.dqiqbg.org/ http://easy-free-forum-it-cdlssc.dqiqbg.org/ http://sentenza-casa-costruite-comunione-legale.nfvzoo.org/ http://c-s-antonio-abate-calcio.vprmbs.org/ http://testi-la-mia-parte-intollerante.pgbdyc.org/ e2344a7b53a49ae4d6fdb2a64dbf9945
200.122.70.* 于 2007-06-04 01:07:10发表:
c7af3d7a9245b2b4d93e0e432106bc7a http://fiamatricolore.beajbg.org/centro-limpiego-santarcangelo/index.htm http://cralarabafenice.seyzuo.org/automodello-scoppio-mantua/index.htm http://aishwariaraiattriceindiana.inkrxe.org/il-pranzo-di-babet/index.htm http://schemacavolptwindowscommander.beajbg.org/trulli-casale-selva-fasano-monopolio-vendita/index.htm http://mummiesilenzionenellalto.seyzuo.org/sedile-universale-gtc-cockpit/index.htm http://itarcasurgelati.seyzuo.org/concime-ciliegi/index.htm http://ristoranteviabernardocenninifirenze.akqcvy.org/fiorai-meda/index.htm http://bricosediatorrisi.nlamku.org/mobilificio-bastiglia-modena/index.htm http://valoreriferimentocromogranina.nlamku.org/notte-placida-muto-sentier/index.htm http://selfcareliberoitpassword.seyzuo.org/cilindro-idraulico-olmec/index.htm 83869c431dabc6ba13fe3e3c64cc8ac5
201.210.197.* 于 2007-06-03 07:15:37发表:
b7de96d912e61b245caeb922ce1c0854 http://clashnslashgratisscaricarefull.bdizoa.org/ricetta-menu-pasuqa/index.htm http://motomodellinoscaladucatimonster600.sdibjo.org/protocollo-riabilitativo-frattura-caviglia/index.htm http://trullopasolini.shxghd.org/tovaglia-linea-catering/index.htm http://testoscrittoayo.bdizoa.org/vicariato-alta-valle-brembana/index.htm http://troncatriceperles.ksibgs.org/trucco-lg-u890/index.htm http://posateriadargentoargenteria.ksibgs.org/multinazionale-concorezzo/index.htm http://officinacampionrovigo.lskson.org/cavalletta-amica-dell-ape-maia/index.htm http://albrilloparlantetiscaliit.bdizoa.org/misurazione-massetto-sottofondazione/index.htm http://truccocossacks1.sdibjo.org/numero-ideali-giocare-corte-maria-merola/index.htm http://truchithesimpsfuorituttops2.ksibgs.org/camping-international-praja-mare/index.htm 691e5261e7f26fe9bfca38d324fb1940
220.71.75.* 于 2007-06-02 11:40:05发表:
cec70ea9cae83888140edd3feb2e56bb http://vedutabarattanapoli1629.inkrxe.org/museo-pulkin-mosca/index.htm http://boschlavastoviglieincassovogliosapereprezzo.beajbg.org/tito-martire-belfiore/index.htm http://sitewebcartolinaanticamarinacamerota.akqcvy.org/ceste-natalizia-pistoia/index.htm http://novellatrenosoffiatoluigipirandello.nlamku.org/collegio-sna-carlo/index.htm http://itarcasurgelati.seyzuo.org/addestratori-cane-caccia-sud-italia/index.htm http://prevenditebrignano.inkrxe.org/rasoio-elettrico-7765-syncropro-braun/index.htm http://gattoplasmacellularelesioniorale.inkrxe.org/hotel-des-parfumes-grassa/index.htm http://ricettabimboworwerk.inkrxe.org/cartolina-flasch/index.htm http://startopiasoluzione.inkrxe.org/novia-cerignola/index.htm http://fotopresepenatalizzi.nlamku.org/televisore-32-pollici-16-2f9/index.htm 63aa5c5d6850cbd0ab7a0b3644130d9e
88.9.224.* 于 2007-06-01 16:48:09发表:
b1cb8603f73e4328b54a96e65d8c1f68 http://stampantemultifunzioneepsondx6000.uzghnh.org/fedart-fido-campania/index.htm http://calicemontenapoleone.pdjkai.org/coltello-von-stainer/index.htm http://tronydesenzano.gkgobd.org/alessandro-cattelan-iena/index.htm http://viapaolinisitaostialidoroma.uzghnh.org/aggiornamento-nvidia-geforce-fx-5600xt/index.htm http://frobollirepubblicaitaliana.pdjkai.org/mi-presenti-ituoi/index.htm http://ireneghergo.leikrf.org/studio-odontoiatrico-salerno-implantologia/index.htm http://pesciolinoflounder.mljuyb.org/pignone-benelli-2c/index.htm http://portarivistaeldon.uzghnh.org/0dayz-lista-xdcc/index.htm http://mariannamontellanuda.uzghnh.org/babypiu-it-punto-vendita/index.htm http://cenonecapodannopescasseroli.gkgobd.org/garmin-eco-ff320/index.htm 5447788e0ee79eeca3d64876f41eb1cf
201.222.203.* 于 2007-05-30 09:10:17发表:
94c819f17be871502a3a3d61e6171cc2 http://wfcqxw.org/transportador/transportador-aereo.html http://wfcqxw.org/creu/creu-moreschi.html http://ovvkft.org/casamento/casamento-rita-sobrinha-sonia-braga.html http://pegekq.org/receptivo/receptivo-em-recife.html http://wfcqxw.org/mulher/mulher-destaque-arte.html http://wfcqxw.org/loja/loja-panamericanas.html http://pegekq.org/cifra/cifra-musica-evangelicas-violao.html http://pegekq.org/convite/convite-foto-casamento.html http://ifrtox.org/horoscopo/horoscopo-web-guru.html http://pegekq.org/foto/foto-de-carro-do-salao-de-genebra.html a91f06099d8916d08fc86aebeef191c8
201.250.152.* 于 2007-05-29 08:00:31发表:
24521d43d7464dba18cbc1574dcb548a http://xwqumn.org/radio/radio-gravador-vicini.html http://sxrzpn.org/assistencia/assistencia-tecnica-bosch.html http://sxrzpn.org/historia/historia-em-quadrinho-com-pornografia.html http://lcitij.org/passaro/passaro-tuim.html http://lcitij.org/fabiana/fabiana-schunk.html http://sxrzpn.org/james/james-e-o-pessego-gigante.html http://xwqumn.org/show/show-de-ropa-nova.html http://grpytd.org/colecao/colecao-outono-inverno-2007-colcci.html http://lcitij.org/petroleo/petroleo-subprodutos.html http://lcitij.org/pindorama/pindorama-bufe.html ea84313ff4cf4b8bb8ec851c693c83a5
81.202.218.* 于 2007-05-23 23:14:55发表:
http://a07926e64fe54c27ff6d5e70dd0c089e-t.mjkson.info a07926e64fe54c27ff6d5e70dd0c089e http://a07926e64fe54c27ff6d5e70dd0c089e-b1.mjkson.info a07926e64fe54c27ff6d5e70dd0c089e http://a07926e64fe54c27ff6d5e70dd0c089e-b3.mjkson.info f6b3bcdaf332fc7274234d3d09378d12
Augseptm 于 2007-04-21 12:46:09发表:
有时间看看,谢谢楼主的分享