�������: ������ (���� | �����������) ��RU opennet.me  
The OpenNET Project / Index page

[ ������� /+++ | ����� | ���� | ]

������� ������������ / ������ "������������ ��� Linux" / ���������� ���������
next up previous contents index
Next: ������ � �������� Linux Up: Samba Previous: ����������� ������� � ������   Contents   Index

������ � SMB-�������� �� Linux

������ � Linux (UNIX) ����� ����� ������������� � ����������� SMB- �������. �������, ��� ��� ����� ���� ������� � ���� �������: ����� �������� �������� ������ � Windows ���� ������ � �������� Samba.

��������� ������� SMB ��� UNIX-����� �������� � ����������� Samba. ��� ������������ ftp-�������� ��������� ��������� ������. ������ ������������ ��� ������� ��� �������� ������ ����� �������� ��� ����������� Windows � �������� ��� Linux. ����������� ������������� Linux ����� �������� ��������� smbfs, ������� ��������� ����������� � �������������� SMB-�������.

��� ����, ����� ������� ����� ������� �������� �� �������, ��������� �������:

/usr/bin/smbclient -L host

��� host - ��� ��� ������, ������� �� ������ �������. ��� ������� ������ ������ ���� ��������, �.�. ���� ������ ��� ���������, � ������� ����� ���� ������� ������. �� ��� ���, ���� SMB-������ �� ����� �������� � ����� ������ ���������� ��������, �� ����� ����������� � ��� ������. ������� � ����� �� ������ ������ ��� ������������ ����� (guest) ��� ��� ������������ ������ �� ���� ������. ��������:

smbclient -L zimmerman

����� ���������� ������ ���� ������� ������ ��������� �������� ���:

Server time is Sat Aug 10 15:58:27 1996
Timezone is UTC+10.0
Password:
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
Server=[ZIMMERMAN] User=[] Workgroup=[WORKGROUP] Domain=[]
        Sharename      Type      Comment
        ---------      ----      -------
        ADMIN$         Disk      Remote Admin
        public         Disk      Public
        C$             Disk      Default share
        IPC$           IPC       Remote IPC
        OReilly        Printer   OReilly
        print$         Disk      Printer Drivers
This machine has a browse list:
        Server               Comment
        ---------            -------
        HOPPER               Samba 1.9.15p8
        KERNIGAN             Samba 1.9.15p8
        LOVELACE             Samba 1.9.15p8
        RITCHIE              Samba 1.9.15p8
        ZIMMERMAN

Browse list ���������� ������ SMB ������� � ���� � ���������� ���������.

��� ����������� �������, ��������� ��������� �������:

usr/bin/smbclient service <password>

��� service - ��� ������ � ������ �������. ��������, ���� �� ��������� ���������� � ����������, ������� �������� ��� ������ public �� ������, ��������� zimmerman, �� ��� ������� ������ ����������� ��� \\zimmerman\public. ������ � ��������� ����������� ��������, ���������� ������������ �������� ����, ��� ��� � ����� ��������� ������ ��������� ��������� �������:

/usr/bin/smbclient \\\\zimmerman\\public mypasswd

��� mypasswd - ���������� ������ ������.

����� �� �������� ����������� smbclient:

Server time is Sat Aug 10 15:58:44 1996
Timezone is UTC+10.0
Domain=[WORKGROUP] OS=[Windows NT 3.51] Server=[NT LAN Manager 3.51]
smb: \>

������� h ����� �������� ������ �� ������������� smbclient:

smb: \> h
ls             dir            lcd            cd             pwd
get            mget           put            mput           rename
more           mask           del            rm             mkdir
md             rmdir          rd             prompt
recurse
translate      lowercase      print          printmode      queue
cancel         stat           quit           q              exit
newer          archive        tar            blocksize
tarmode
setmode        help           ?              !
smb: \>

���� �� ������ ������������ ftp, �� ��� ����� ������� ���������� �������� �� smbclient.

��� ������������ ������ � Samba, ��� ������ ����� ����������� ����� smbfs. smbfs ������������ � ����� �������� ���������, smbmount � smbumount. ��� �������� ������� mount � umount ������������� � SMB-��������.

������ ���������: ����� ������������ ��� �������, ���� ������ ���� �������������� � ���������� smbfs.

��������� ������ ���������� �������� ������������� smbmount ��� ������������ SMB-�������, ���������� customers �� ������ � ������ samba1:

[root@postel]# smbmount "\\\\samba1\\customers" -U rtg2t -c 'mount /customers -u 500 -g 100'
Added interface ip=192.168.35.84 bcast=192.168.255.255
nmask=255.255.0.0
Got a positive name query response from 192.168.168.158 (192.168.168.158 )
Server time is Tue Oct  5 10:27:36 1999
Timezone is UTC-4.0
Password:
Domain=[IPM] OS=[Unix] Server=[Samba 2.0.3]
security=user

��������� ������ ������� mount ������� ���, ��� ������ ����������� ����� �����, ��� � � ������ � NFS:

[root@postel]# mount
/dev/hda2 on / type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=622)
//SAMBA1/CUSTOMERS on /customers type smbfs (0)

���������� ���������� �������� smbmount � smbumount ��� ��������� �������������� ���������� �� ��������� ���� ���������.



Alex Otwagin 2002-12-16



������:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
�������:

�������� �� �����
���������� �� ���������
Created 1996-2026 by Maxim Chirkov
��������, ����������, ����������