Review your favorite Linux distribution.
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 06-20-2003, 09:34 PM   #1
Registered: May 2003
Location: Adelaide, Australia
Distribution: Fedora Core 3
Posts: 52

Rep: Reputation: 15
Access Denied from Windows XP

Hi Guys,
I have searched around the forum for answers and have found a couple of things which I thought may have been able to help but no such luck so far.

Anyway here's the problem. I have 2 machines one being a Mandrake 9 box running Samba v2.2.7a and a Windows XP machine. I was always getting workgroup not found and problems like that until I allowed ports 137 - 139 and now that works which is great.

The trouble is though I am getting 'Access Denied' errors whenever I attempt to copy a file or create a file in one of the samba shares. I thought I had setup so I could write to the directory but I have gone wrong somewhere.

I have a user and group called darrenk on the linux box and I login on the windows machine as darrenk with the same password I have setup for linux and samba users.

Basically what I want to achieve is to use Samba for a simple case of being able to access my web logs and error logs and able to delete them whenever I feel like it. Also I want to put common applications which I use all the time on the machine so they are accesible whenever I want but I can't copy them across.

The partition with the most available space is the /home directory so ideally I want to be able to write to /home/Apps.

Below is a copy of my smb.conf file, I have taken out anything which I feel is irrelevant. Any help working out this problem would be great and very much appreciated

I am by no means an expert, infact the opposite.

# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable

#======================= Global Settings =====================================

# 1. Server Naming Options:
# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = WORKGROUP

# netbios name is the name you will see in "Network Neighbourhood",
# but defaults to your hostname
netbios name = Server

# server string is the equivalent of the NT Description field
server string = Linux Box
# %v - shows version of samba

# Security and Domain Membership Options:
# 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. Do not enable this if (tcp/ip) name resolution does
# not work for all the hosts in your network.
hosts allow = 192.168.1. 127.

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest
# Allow users to map to guest:
map to guest = bad user

# 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 or security = domain
# When using security = domain, you should use password server = *
; password server = <NT-Server-Name>
password server = *

# 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
# Encrypted passwords are required for any use of samba in a Windows NT domain
# The smbpasswd file is only required by a server doing authentication, thus
# members of a domain do not need one.
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd

# The following are needed to allow password changing from Windows to
# also update the Linux system password.
# 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
# You either need to setup a passwd program and passwd chat, or
# enable pam password change
; pam password change = yes
; passwd program = /usr/bin/passwd %u
; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n

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

# Options for using winbind. Winbind allows you to do all account and
# authentication from a Windows or samba domain controller, creating
# accounts on the fly, and maintaining a mapping of Windows RIDs to unix uid's
# and gid's. winbind uid and winbind gid are the only required parameters.
# winbind uid is the range of uid's winbind can use when mapping RIDs to uid's
winbind uid = 10000-20000
# winbind gid is the range of uid's winbind can use when mapping RIDs to gid's
winbind gid = 10000-20000
# winbind separator is the character a user must use between their domain
# name and username, defaults to "\"
winbind separator = \
# winbind use default domain allows you to have winbind return usernames
# in the form user instead of DOMAIN+user for the domain listed in the
# workgroup parameter.
winbind use default domain = yes
# template homedir determines the home directory for winbind users, with
# %D expanding to their domain name and %U expanding to their username:
template homedir = /home/%D/%U

# When using winbind, you may want to have samba create home directories
# on the fly for authenticated users. Ensure that /etc/pam.d/samba is
# using 'service=system-auth-winbind' in pam_stack modules, and then
# enable obedience of pam restrictions below:
obey pam restrictions = yes

# template shell determines the shell users authenticated by winbind get
template shell = /bin/bash

# 5. Browser Control and Networking Options:
# 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 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 =

# 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

# Name Resolution Options:
# All NetBIOS names must be resolved to IP Addresses
# 'Name Resolve Order' allows the named resolution mechanism to be specified
# the default order is "host lmhosts wins bcast". "host" means use the unix
# system gethostbyname() function call that will use either /etc/hosts OR
# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
# and the /etc/resolv.conf file. "host" therefore is system configuration
# dependant. This parameter is most often of use to prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that are NOT
# on the local network segment
# - OR - are not deliberately to be known via lmhosts or via WINS.
; name resolve order = wins lmhosts bcast

# 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

# Share Definitions

comment = Home Directories
browseable = no
writable = yes

[Web Page]
comment = Web Page
path = /var/www/html
browseable = yes
writable = yes

comment = Apache Logs
path = /etc/httpd/logs
browseable = yes
writable = yes

comment = Shared Applications
path = /home/Apps
browseable = yes
writable = yes

Last edited by bLaDe; 06-20-2003 at 09:36 PM.
Old 06-21-2003, 04:42 AM   #2
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,934

Rep: Reputation: 128Reputation: 128
You seem to have the same trouble I am having. It must stem from the fact that root is the owner, and therefore, you can't copy to root, but only to your user dir.

From days of reading, the only thing I can tell you is this:

What does work for me is to setup my user account in samba, give it a password, and then login to samba server from the xp machine with that user name and password. Once you do this, you can copy files to that particular directory, but not the share directory created under it. For instance, on my machine, I can copy into /home/<user> and that is all.

In the linux box, right-click on your Apps folder, choose properties, and I'll bet it has in the permissions in Ownership this - Owner: root and Group: root

I can't copy a file from the desktop of my linux box to anywhere under root.

Therefore, I believe the problem has to do with permissions in the linux file structure - but I haven't got a clue how to change them , and nobody has posted that answer yet - but, it will happen.
Old 06-21-2003, 07:29 PM   #3
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,934

Rep: Reputation: 128Reputation: 128
To your Access Denied message, I believe this is the problem, and the solution. This is what worked for me due to root owning the folder and the user not being able to write to it.

I cannot copy files over the network, or in Linux, to the new share folder I created. It's ownership is root, not the user. How do I change ownership of folders from root to a user?

from command line as root:
# man chown
chown is what you're looking for to "Change Ownership"
chown -R Chinaman.Chinaman /home/Chinaman
will chown everything in /home/Chinaman to login user Chinaman.Chinaman (Chinaman user, Chinaman group)

In your example, I believe you would substitute /home/darrenk where I have /home/Chinaman and then you would be able to write to /home/Apps.

Please let me know if this helps you, as I live my life in a learning mode. My little business here is Computer Doctor.

As soon as I get reasonable substitutes for Photoshop and PageMaker to use in Linux, I won't use M$ Windoze anymore.

Looking forward to the day of my delivery!
Old 06-21-2003, 10:26 PM   #4
Registered: May 2003
Location: Adelaide, Australia
Distribution: Fedora Core 3
Posts: 52

Original Poster
Rep: Reputation: 15
Thank you Chinaman, that worked an absolute treat!
Old 06-22-2003, 01:18 AM   #5
Bruce Hill
HCL Maintainer
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo (all servers at work are openSUSE)
Posts: 6,934

Rep: Reputation: 128Reputation: 128
You're welcome. Glad to be able to *give something back* in these forums.


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 - access denied on windows time112852 Linux - Software 11 06-04-2010 11:08 AM
Windows FTP Access Denied Tezdread Linux - Networking 5 06-09-2009 04:44 PM
Samba - access denied on windows suco Linux - Software 6 09-26-2005 11:30 PM
Access denied to windows partition. akihandyman Mandriva 6 08-25-2004 03:10 AM
windows xp and samba access denied eradiate Linux - Networking 4 06-01-2003 10:58 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:08 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration