Samba 관련 유용한 명령어들

[root@owl45 samba]# smbpasswd -a owl
New SMB password:
Retype new SMB password:
Added user owl.
[root@owl45 samba]# smbclient -L owl45 -l 192.168.0.45 -U owl
Enter owl's password:

Sharename Type Comment
--------- ---- -------
public Disk Public Stuff
IPC$ IPC IPC Service (OWL45)
owl Disk Home Directories

Server Comment
--------- -------

Workgroup Master
--------- -------

[root@owl45 samba]# findsmb

*=DMB
+=LMB
IP ADDR NETBIOS NAME WORKGROUP/OS/VERSION
---------------------------------------------------------------------
192.168.0.41 IMAC2013LATE [ WORKGROUP ]
192.168.0.80 IMACMID2011 [ WORKGROUP ]
192.168.0.109 MACBOOK2006 [ WORKGROUP ]
192.168.0.153 MACBOOKPRO-3790 [ WORKGROUP ]

[root@owl43 public]# net -l share -S owl43
Enter root's password:

Enumerating shared resources (exports) on remote server:
Share name Type Description
---------- ---- -----------
public Disk Public Stuff
IPC$ IPC IPC Service (OWL43)
root Disk Home Directories
[root@owl43 public]# smbstatus

Samba version 3.6.23-12.el6
PID Username Group Machine
-------------------------------------------------------------------

Service pid machine Connected at
-------------------------------------------------------

No locked files

[root@owl43 public]# smbstatus

Samba version 3.6.23-12.el6
PID Username Group Machine
-------------------------------------------------------------------
6045 root root owl1c03 (192.168.0.145)

Service pid machine Connected at
-------------------------------------------------------
public 6045 owl1c03 Sun Dec 14 07:24:17 2014
IPC$ 6045 owl1c03 Sun Dec 14 07:24:17 2014

Locked files:
Pid Uid DenyMode Access R/W Oplock SharePath Name Time
--------------------------------------------------------------------------------------------------
6045 0 DENY_NONE 0x100081 RDONLY NONE /home/public . Sun Dec 14 07:24:17 2014
[root@owl45 samba]# smbclient -L owl43
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23-12.el6]

Sharename Type Comment
--------- ---- -------
public Disk Public Stuff
IPC$ IPC IPC Service (OWL43)
root Disk Home Directories
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23-12.el6]

Server Comment
--------- -------

Workgroup Master
--------- -------

[root@owl45 home]# smbclient //192.168.0.40/p$ -U administrator
Enter administrator's password:
Domain=[OWLOFFICE] OS=[Windows 7 Ultimate 7600] Server=[Windows 7 Ultimate 6.1]
smb: \> exit