Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-28-2005, 05:53 AM   #1
LQ Newbie
Registered: Sep 2003
Posts: 19

Rep: Reputation: 0
smb.conf assistance on read/write server

I am trying to set up a samba share on Fedora Core 4.

Here is the smb.conf I am trying to make work.
# workgroup = NT-Domain-Name or Workgroup-Name
	workgroup = home
	netbios name = LINUXBOX
# server string is the equivalent of the NT Description field

# 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
;   printing = cups

# This option tells cups that the data has already been rasterized
	cups options = raw

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
	guest account = roomate

# this tells Samba to use a separate log file for each machine
# that connects
	log file = /var/log/samba/%m.log
# all log information in one file
#   log file = /var/log/samba/log.smbd

# Put a capping on the size of the log files (in Kb).
	max log size = 50

# 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
;   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/samba/smbpasswd

# 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.
# 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*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*

# 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

# 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
# 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

# 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

# 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 ==============================
	idmap uid = 16777216-33554431
	idmap gid = 16777216-33554431
	template shell = /bin/false
	winbind use default domain = no
	encrypt passwords = no

	path = /home
	comment = Home Directories
	browseable = yes
	writeable = yes
	read only = No
	guest ok = Yes
	force user = share
	force group = home
	nt acl support = No

	path = /home/Share
	writeable = yes
	browseable = yes
	read only = No
	guest ok = Yes
I want the shares to be fully read/write by anyone without anyone having to log in. I intend to use samba alongside ftp on our lan to transfer files over to test on apache/php/mysql which I may also be back asking for help setting up.

If anyone knows why I get an ERROR everytime I try to access these shares please post back. I have tried just about every tutorial on the subject and nothing has actually worked.
Old 09-28-2005, 08:02 AM   #2
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
One way is to have;
force group shared
in the [share] section with your users as members of that group. Then
# chown -R .shared /home/share <- notice the period

Drill down to;
Tell me if you have an "index.html" there or what is there.
Old 09-28-2005, 04:10 PM   #3
LQ Newbie
Registered: Sep 2003
Posts: 19

Original Poster
Rep: Reputation: 0

Ok so here is the update... I tried what you said and I assume it gave read access to the share folder for the share username... well didn't do the trick...

I uploaded a pdf screen capture of my konsole in the dir you told me to navigate to...
Old 09-28-2005, 04:46 PM   #4
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
It works when it's setup, probably missed something being new and all. The rapidshare only showed a signup screen.

Do you have the index.html file? If so just click on it. You should have the entire Samba docs as;
Plus enough to read for months. RH ships the same thing as the Samba web site. You can also go to;
On the left you'll see a bunch of docs. Click on "By Example". Section I, chapter 1,etc.... will give you very detail step by step examples to setup different type of environments. You'll see what I mean once you get there. You'll also see the force group <group> as I mentioned.

As I said, you should have the exact same thing installed in /usr/share/doc/samba<....>/<here> and /usr/share/doc/samba<....>/htmldocs.

Look through the docs. Rather than kick it around here, (which I don't mind) for days/weeks/months, you'll get up and running quicker. If you get stumped on a topic, come-on back and we'll kick it around. I'll be around when you need help.

Last edited by -X-; 09-28-2005 at 04:51 PM.
Old 09-28-2005, 04:52 PM   #5
LQ Newbie
Registered: Sep 2003
Posts: 19

Original Poster
Rep: Reputation: 0
Hey -X-

I have been through that route in the paste when setting up Samba but I just have such a workload from school this quarter and on top of that I am trying to do some PC repair on the side. Basically this is a plea for someone to just help me fix the error by posting the correction for my smb.conf file or by posting me a working smb.conf file and i'll make the necessary changes to it for my shares.

I know its the easy way out but I want to put all the time I can into working on these website projects and this samba share nonsense is slowing down everything.

:-) Thanks for any help anyone can provide regarding this plea.

.:: Edit ::.
For the moment me and my roommates are just testing our site on a live server but its wasting space and bandwidth to keep uploading these graphics and I would like to avoid the cost.

Last edited by jer2eydevil88; 09-28-2005 at 04:55 PM.
Old 09-28-2005, 05:03 PM   #6
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
If you want an easy way, kinda wide open, the put;
create mode = 777
in the shared sections.

create mode = 775
will tighten things down a bit, but user will need to be in groups.
Old 09-28-2005, 05:11 PM   #7
LQ Newbie
Registered: Sep 2003
Posts: 19

Original Poster
Rep: Reputation: 0
Hi -X-

I chmodded the dir's 777 before even posting here... its something in the smb.conf file i'm afraid...

Here are some of the things I have attempted already since yesterday. (I revert to backups when something fails)
I even created several users on the linux box with the same name as my windows clients machines in an attempt to bypass the error which didn't work. I re-enabled the guest account in my windows box and turned off the force user mode which resulted in a login prompt with the username grayed out and filled in with guest however no matter what password i entered (even blank) it wouldn't connect. I tried to assign the share to the nic card in the hopes that would force it work.

I know its not a firewall issue because I was able to set up vnc and connect (all be it to a console) but it still works.
Old 09-28-2005, 05:45 PM   #8
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Unless FC4 has a Samba problem I haven't heard about, the smb.conf work pretty much "right out of the box".

137:udp, 138:udp, 139:tcp, 445:tcp

To match Windows I set
workgroup = workgroup
security = user
uncomment the [tmp] section
smbpasswd -a <user> <same pw as Windows>
service smb restart
And you're ready to go for the "standard" setup. Works every time.

Create extra shares as needed adding;
create mode = 777
as mentioned above.

That's works for "ready to go" Samba. Every time... in every distro I setup. Well.... I don't do the 777 and use groups with tighter settings, but you get what I mean.

The 777 will give full rw permissions. Which is what you're looking for.

Last edited by -X-; 09-28-2005 at 07:29 PM.
Old 09-28-2005, 05:53 PM   #9
Senior Member
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016

Rep: Reputation: 47
Re: smb.conf assistance on read/write server

i think you need to have encrypt passwords = yes if you are using 2000/XP. you didn't mention what windows, but i believe = no works with 98 and down. not sure about ME, but no one should be running that anyway.

btw, in the future, you can just run "testparm" and post that instead of the whole smb.conf file.
Old 09-28-2005, 07:26 PM   #10
Registered: Oct 2003
Location: Tx,USA
Distribution: Slackware, Red Hat, CentOS
Posts: 495

Rep: Reputation: 30
Yeah, he may give encrypt passwords a try and see what happens. I don't set it RH or Slackware... users and shared directories all work fine as they should. Been a while since I've read through the docs, some of the settings are on by default, but not sure here though. At this point I think he will try anything.


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
Example share in smb.conf doesn't work - read/write vs read only kleptophobiac Linux - Networking 0 09-01-2004 07:14 PM
Why is smb.conf read only? spike0 Linux - Software 3 08-20-2004 06:51 PM
How can I do an automated Read/Write SMB mount for a normal user? molear Linux - Newbie 1 07-01-2004 02:45 PM
SMB Read/Write Problem dhammika Linux - Networking 3 05-12-2004 11:03 AM
smb.conf file write permission jbraum Mandriva 3 01-09-2004 05:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:57 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
Open Source Consulting | Domain Registration