$findsmb
*=DMB
+=LMB
IP ADDR NETBIOS NAME WORKGROUP/OS/VERSION
---------------------------------------------------------------------
192.168.2.25 RENOY [RENOY] [Unix] [Samba 3.0.28a]
192.168.2.27 HOST14 [WORKGROUP] [Unix] [Samba 3.0.28a]
192.168.2.30 USER-DESKTOP [WORKGROUP] [Unix] [Samba 3.0.28a]
192.168.2.31 UBUNTU [WORKGROUP] [Unix] [Samba 3.0.28a]
192.168.2.32 UBUNTU +[UBUNTU] [Unix] [Samba 3.0.28a]
192.168.2.33 ZODIAC-DESKTOP [ZODIAC-DESKTOP] [Unix] [Samba 3.0.28a]
192.168.2.37 UBUNTU [WORKGROUP] [Unix] [Samba 3.0.28a]
192.168.2.43 SAGGAR [SAGGAR] [Unix] [Samba 3.0.28a]
192.168.2.44 AJAI [WORKGROUP] [Unix] [Samba 3.0.28a]
To view a text representation of your network neighbourhood(shared dir & printers)
sudo smbtree

To add an existing linux user as a samba user
sudo smbpasswd -a username
To list services offered by a server to an anonymous user
smbclient -L server
to get o/p from smbclient for a specific user named francois
smbclient -L server -U francois
Mounting Samba Shares
You can mount remote Samba shares on your local file system much as you would a local file
system or remote NFS file system. To mount the share:
$ sudo mount -t smbfs -o username=francois,password=MySecret \
//192.168.1.1/myshare /mnt/mymount/
NOTE The Samba file system (smbfs) is deprecated and should no longer be used in some Linux distributions; however, this is the type supported on Ubuntu. In other distributions, the preferred method is to indicate CIFS (-t cifs) as the file system type when you mount a remote Samba share.
You can see the current connections and file locks on a server using the smbstatus command. This will tell you if someone has mounted your shared directories or is currently using an smbclient connection to your server:
$ sudo smbstatus
Looking Up Samba Hosts
NetBIOS names are used to identify hosts in Samba. You can determine the IP address of a
computer using the nmblookup command to broadcast for a particular NetBIOS name on the local subnet as follows:
$ nmblookup thompson
querying thompson on 192.168.1.255
192.168.1.1 server1<00>
To find the IP address for a server on a specific subnet, use the -U option:
$ nmblookup -U 192.168.1.255 server1
querying server1 on 192.168.1.255
192.168.1.1 server1<00>
Checking Samba Configuration
If you are unable to use a Samba share or if you have other problems communicating with your Samba server, you can test the Samba configuration on the server. The testparm command can be used to check your main Samba configuration file (smb.conf):
$ testparm
Load smb config files from /etc/samba/smb.conf
Processing section “[homes]”
Processing section “[printers]”
Processing section “[myshare]”
Loaded services file OK.
Server role: ROLE_STANDALONE
Press Enter to see a dump of your service definitions
No comments:
Post a Comment