Wednesday, November 10, 2010

Troubleshooting Samba Server

Troubleshooting Samba Server

If your Samba server isn’t working properly you need to check the following procedure

1) First you need to check your basic networking is working or not

2) Check Samba Service is Running or not using the following command

$ smbclient -L localhost
Password: **********

3) Make sure that your firewall ports are open.You need to open access to ports 137, 138,139 and 445 in your firewall so that the Samba server can accept connections for services.

4) Make sure user passwords are working.Try accessing a shared Samba directory as a particular user using the

following command.

# smbclient //localhost/tmp -U david

In this example, smbclient connects to the directory share named tmp as the Samba user named david. If the password is
accepted, you should see information about the server and a smb:\> prompt.

Checking smbd with telnet

Ironically, the easiest way to test that the smbd server is actually working is to send it a meaningless message and see if it is rejected. Try something such as the following:

$ echo "hello" | telnet localhost 139 
Trying
Trying 192.168.236.86 ...
Connected to localhost. Escape character is '^]'.
Connection closed by foreign host.
This sends an erroneous but harmless message to smbd. If you get a Connected message followed by a Connection closed message, the test was a success. You have an smbd daemon listening on the port and rejecting improper connection messages. On the other hand, if you get telnet: connect: Connection refused, most likely no daemon is present.

Testing daemons with testparm

Once you know there's a daemon, you should always run testparm, in hopes of getting something such as the following:

$ testparm 
Load smb config files from /opt/samba/lib/smb.conf
Processing section "[homes]"
Processing section "[printers]" ...
Processing section "[tmp]"
Loaded services file OK. ...

The testparm program normally reports the processing of a series of sections and responds with Loaded services file OK if it succeeds. If not, it reports one or more of the following messages, which also appear in the logs as noted:

Samba Security

If you would like to share your folder to client but hidden some specific extention
files likes .exe , .mp3, .sh etc.. you can do also with " veto file " option.

[data]
path = /home/samba/data
browseable = yes
guest ok = yes
writeable = yes
case sensitive = no
veto files = /*.java/*README*/*.mp3/

No comments:

Post a Comment