Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-23-2006, 06:29 AM   #1
LQ Newbie
Registered: Apr 2006
Posts: 13

Rep: Reputation: 0
Smile Samba problem

hi gud day to all. I just configured my samba, but i have encountered problem in accessing on my windows xp machine. I was able to see the Samba server on the xp machine but when i click on it i encountered an error \\Localhost is not accessible. you might not have permission tyo use this network resource.
I did not set any password on my xp machine and also the firewall was turn off. below is my smb.conf details. Pls help


# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = Samba Server

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
hosts allow = 192.168.1. 192.168.2. 127.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
printcap name = /etc/printcap
load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
printing = cups

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
guest account = smbuser
# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# Put a capping on the size of the log files (in Kb).
max log size = 0

# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = SHARE

# Use password server option only with security = server
# The argument list may include:
# password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
password server = *
; password server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
; password level = 8
; username level = 8

# You may wish to use password encryption. Please read
# ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
# Do not enable this option unless you have read those documents
encrypt passwords = yes
smb passwd file = /etc/smbpasswd

# The following is needed to keep smbclient from spouting spurious errors
# when Samba is built with support for SSL.
; ssl CA certFile = /usr/share/ssl/certs/ca-bundle.crt

# The following are needed to allow password changing from Windows to
# update the Linux system password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
79,1 16%

# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
unix password sync = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# You can use PAM's password change control flag for Samba. If
# enabled, then PAM will be used for password changes when requested
# by an SMB client instead of the program listed in passwd program.
# It should be possible to enable this without changing your passwd
# chat parameter for most setups.

pam password change = yes

# Unix users can map to different SMB User names
; username map = /etc/samba/smbusers

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /etc/samba/smb.conf.%m

# This parameter will control whether or not Samba should obey PAM's
# account and session management directives. The default behavior is
# to use PAM for clear text authentication only and to ignore any
# account or session management. Note that Samba always ignores PAM
# for authentication in the case of encrypt passwords = yes

obey pam restrictions = yes

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces =

# Configure remote browse list synchronisation here
# request announcement to, or browse list sync from:
# a specific host or from / to a whole subnet (see below)
; remote browse sync =
# Cause this host to announce itself to local subnets here
; remote announce =

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
; local master = no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
; domain master = yes

# Preferred Master causes Samba to force a local browser election on startup
# and gives it a slightly higher chance of winning the election
; preferred master = yes

# Enable this if you want Samba to be a domain logon server for
145,1 39%

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
; wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no

178,0-1 51%

# Case Preservation can be handy - system default is _no_
# NOTE: These can be set on a per share basis
; preserve case = no
; short preserve case = no
# Default case is normally upper case for all DOS files
; default case = lower
# Be very careful with case sensitivity - it can break things!
; case sensitive = no

#============================ Share Definitions ==============================
comment = Home Directories
browseable = yes
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
# If you want users samba doesn't recognize to be mapped to a guest user
; map to guest = bad user

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /usr/local/samba/lib/netlogon
; guest ok = yes
; writable = no
; share modes = no
Old 04-23-2006, 06:55 AM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What distro do you use? Fedora, and I'd guess anything else that employs SELinux, can be problematic because of SELinux. I had to turn off SELinux security for smbd.
Old 04-23-2006, 07:30 AM   #3
LQ Newbie
Registered: Jul 2004
Location: Berlin, Germany
Distribution: Debian Sarge, Fedora Core 4, Suse 9.1
Posts: 13

Rep: Reputation: 0

First take a look at the following line
hosts allow = 192.168.1. 192.168.2. 127.
You have to make sure that the IP address of your XP box is within one of those subnets.

Next there is only one share defined (homes), which is used for specific users logging on. But you defined share level security. Try to change to user level security:
security = USER
Setup a share like this.
   comment = test share
   path = /your/path
   browseable = yes
   read only = yes
   writable = no
   public = yes
   guest ok = yes
   map to guest = bad user
Define a valid guest account.
guest account = nobody
Make sure the directory of your share is readable and executable by your guest account (in this case "nobody").

Restart your samba server.

Next, open a command prompt window on your XP box and type the following:
nbtstat -RR
nbtstat -r
You should see a list of discovered netbios servers including your samba server. If so, netbios is working. If not, there is probably something wrong with the firewall on your linux box. You should allow IP broadcasts and ports 137, 138, 139 for TCP and UDP.

Now try to connect directly to your share:
net use * \\linux-server\test
There is no need to specify a specific user account, because you enabled the guest account.
Old 04-23-2006, 07:54 AM   #4
Registered: Oct 2005
Location: Bhopal, India
Distribution: RHEL 6
Posts: 422

Rep: Reputation: 30
If you really want your shared folders to be available to specific users, switch to root and type the command -
smbpasswd -a anyusername
give a password.
And you will get a message like
Added user anyusername
Now, in your /etc/samba/smb.conf file
   comment = test share
   path = /your/path
   writable = no
   public = no
   valid users = anyusername
Like what rolsch have written,
you must check this line, try commenting it for a while if not sure.
hosts allow = 192.168.1. 192.168.2. 127.

Last edited by manishsingh4u; 04-23-2006 at 07:56 AM.
Old 04-23-2006, 09:57 AM   #5
LQ Newbie
Registered: Apr 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Samba Problem

hi thanks for the reply. I have refreshed by netbios on my XP machine using this command nbtstat -RR and nbtstat -r, and also allowed the UDP as well the TCP for 139,137, and 138 on my IPtables. Also the ip of of both my linux and my XP machine were both on 192.168.1 addresses. Iver tried turning off the firewall for both machine but still unable to access. Btw now i can see the samba server but when i click on it it will ask for my password but when i type the correct passwrd it does not accept. my passwrd is only 123456 for testing. and when i access it again the error reoccur that it unable to access \\localhost is not accessible/ You might not have access on the network resources. Im using Redhat 9.0. below is my testpram result. thanks
Old 04-23-2006, 10:00 AM   #6
LQ Newbie
Registered: Apr 2006
Posts: 13

Original Poster
Rep: Reputation: 0
Samba Problem

heres my #testpram

Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[printers]"
Processing section "[myshare1]"
Loaded services file OK.
Press enter to see a dump of your service definitions

# Global parameters
coding system =
client code page = 850
code page directory = /usr/share/samba/codepages
workgroup = MSHOME
netbios name =
netbios aliases =
netbios scope =
server string = Samba Server
interfaces =
bind interfaces only = No
security = SHARE
encrypt passwords = Yes
update encrypted = No
allow trusted domains = Yes
hosts equiv =
min passwd length = 5
map to guest = Never
null passwords = No
obey pam restrictions = Yes
password server = 123456
smb passwd file = /etc/smbpasswd
root directory =
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
passwd chat debug = No
username map =
password level = 0
username level = 0
unix password sync = Yes
restrict anonymous = No
lanman auth = Yes
use rhosts = No
admin log = No
log level = 0
syslog = 1
syslog only = No
log file = /var/log/samba/%m.log
max log size = 50000
timestamp logs = Yes
debug hires timestamp = No
debug pid = No
debug uid = No
protocol = NT1
large readwrite = Yes
max protocol = NT1
min protocol = CORE
read bmpx = No
read raw = Yes
write raw = Yes
nt smb support = Yes
nt pipe support = Yes
nt status support = Yes
announce version = 4.9
announce as = NT
max mux = 50
max xmit = 16644
name resolve order = lmhosts host wins bcast
max ttl = 259200
max wins ttl = 518400
min wins ttl = 21600
time server = No
unix extensions = No
change notify timeout = 60
deadtime = 0
getwd cache = Yes
keepalive = 300
lpq cache time = 10
max smbd processes = 0
max disk size = 0
max open files = 10000
name cache timeout = 660
read size = 16384
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
stat cache size = 50
use mmap = Yes
total print jobs = 0
load printers = Yes
printcap name = /etc/printcap
disable spoolss = No
enumports command =
addprinter command =
deleteprinter command =
show add printer wizard = Yes
os2 driver map =
strip dot = No
mangling method = hash
character set =
mangled stack = 50
stat cache = Yes
domain admin group =
domain guest group =
machine password timeout = 604800
add user script =
delete user script =
logon script =
logon path = \\%N\%U\profile
logon drive =
logon home = \\%N\%U
domain logons = No
os level = 20
lm announce = Auto
lm interval = 60
preferred master = Auto
local master = Yes
domain master = Auto
browse list = Yes
enhanced browsing = Yes
dns proxy = No
wins proxy = No
wins server =
wins support = No
wins hook =
kernel oplocks = Yes
lock spin count = 3
lock spin time = 10
oplock break wait time = 0
add share command =
change share command =
delete share command =
config file =
preload =
lock dir = /var/cache/samba
pid directory = /var/run/samba
utmp directory =
wtmp directory =
utmp = No
default service =
message command =
dfree command =
valid chars =
remote announce =
remote browse sync =
socket address =
homedir map = auto.home
time offset = 0
NIS homedir = No
source environment =
panic action =
hide local users = No
host msdfs = No
winbind uid =
winbind gid =
template homedir = /home/%D/%U
template shell = /bin/false
winbind separator = \
winbind cache time = 15
winbind enum users = Yes
winbind enum groups = Yes
winbind use default domain = No
comment =
path =
alternate permissions = No
username =
guest account = smbuser
invalid users =
valid users =
admin users =
read list =
write list =
printer admin =
force user =
force group =
read only = Yes
create mask = 0744
force create mode = 00
security mask = 0777
force security mode = 00
directory mask = 0755
force directory mode = 00
directory security mask = 0777
force directory security mode = 00
force unknown acl user = 00
inherit permissions = No
inherit acls = No
guest only = No
guest ok = No
only user = No
hosts allow = 192.168.1. 192.168.2. 127.
hosts deny =
status = Yes
nt acl support = Yes
profile acls = No
block size = 1024
max connections = 0
min print space = 0
strict allocate = No
strict sync = No
sync always = No
write cache size = 0
max print jobs = 1000
printable = No
postscript = No
printing = cups
print command = lpr -r -P%p %s
lpq command = lpq -P%p
lprm command = lprm -P%p %j
lppause command =
lpresume command =
queuepause command =
queueresume command =
printer name =
use client driver = No
default devmode = No
printer driver =
printer driver file = /etc/samba/printers.def
printer driver location =
default case = lower
case sensitive = No
preserve case = Yes
short preserve case = Yes
mangle case = No
mangling char = ~
hide dot files = Yes
hide unreadable = No
delete veto files = No
veto files =
hide files =
veto oplock files =
map system = No
map hidden = No
map archive = Yes
mangled names = Yes
mangled map =
browseable = Yes
blocking locks = Yes
csc policy = manual
fake oplocks = No
locking = Yes
oplocks = Yes
level2 oplocks = Yes
oplock contention limit = 2
posix locking = Yes
strict locking = No
share modes = Yes
copy =
include =
exec =
preexec close = No
postexec =
root preexec =
root preexec close = No
root postexec =
available = Yes
volume =
fstype = NTFS
set directory = No
wide links = Yes
follow symlinks = Yes
dont descend =
magic script =
magic output =
delete readonly = No
dos filemode = No
dos filetimes = No
dos filetime resolution = No
fake directory create times = No
vfs object =
vfs options =
msdfs root = No

comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775

comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No

comment = marvin's share folder
path = /home/marvin1
valid users = marvin1
read only = No
create mask = 0765
printable = Yes
Old 04-23-2006, 10:34 AM   #7
Registered: Aug 2002
Posts: 24,995

Rep: Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682Reputation: 5682
RH9 assigned localhost to be the computers hostname however it isn't a valid network name. localhost is the local network loopback device i.e. on all computers so your actually trying to connect to the XP PC instead of the linux PC. samba by default uses the computers hostname but you can change the network name in the smb.conf file global section as shown below. Change linux to the name of your choosing.

netbios name = linux

Be sure to restart samba for the changes to take effect.
Old 04-23-2006, 11:57 AM   #8
Registered: Oct 2005
Location: Bhopal, India
Distribution: RHEL 6
Posts: 422

Rep: Reputation: 30
Originally Posted by michaelk
localhost is the local network loopback device i.e. on all computers so your actually trying to connect to the XP PC instead of the linux PC.
Wow. Nobody noticed that.
Old 04-25-2006, 10:29 PM   #9
LQ Newbie
Registered: Apr 2006
Posts: 13

Original Poster
Rep: Reputation: 0
thanks for the reply. i have configured samba the same way with your instructions and samba now working.. thanks to all who have shared their knowledge


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba - Windows XP Problem (//Samba is not accessible) Covenent Linux - Networking 20 08-11-2011 05:07 PM
samba 3 problem - samba PDC can not join to the domain ananthak Linux - Networking 1 05-21-2006 11:39 AM
Samba AD Problem eantoranz Linux - Software 1 10-08-2005 10:58 PM
samba problem John Micheal Linux - Networking 8 04-17-2004 11:56 AM
when i restart SAMBA,it says:stop samba failed,start SAMBA OK! whepin Linux - Networking 3 12-26-2001 06:54 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration