LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 07-09-2012, 11:41 AM   #1
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Rep: Reputation: 18
Apparently I need lots of help creating a Samba server (Slackware64 13.37)


So I've spent the last week trying to get a computer configured to operate as a server for my small home network of Windows 7 computers, and to be honest, it's been extremely frustrating. It took me ~5 days (starting June 30) just to get the Slackware computer to boot and since then I've been trying to get Samba working, to no avail. Yesterday I rage-quit and wiped everything I've done to the computer and decided that I really didn't need a home server...

But that itch still requires some scratching apparently...

So once I begin again, I should be able to get the OS operational within a few hours since I've learned from the constant mistakes and little system-specific things that prevented me from getting a properly running OS originally. However, I'm still at a loss as for trying to get Samba working the way I'd like. I went through tons of tutorials (including a bunch of threads from LQ and AlienBOB's Samba wiki entry, amoung others that were OS agnostic) and was met with failure every single time. Since I nuked the system yesterday, I'll have a fresh Slackware install to work on.

Here is what I would like to accomplish:
1) The share itself will directory to which a hard drive dedicated to storage will be mounted to (which shouldn't be overly hard, but I think I may need help in getting file permissions correct)
2) The Samba share should be read/write for any Windows 7 PC that happens to connect to my LAN, complete with no authentication windows or configuration of Windows 7 computers needed. Access from the Windows 7 computers should be as easy as point and click.

I'll be eternally grateful for all help!
 
Old 07-09-2012, 12:10 PM   #2
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 890

Rep: Reputation: 78
Well, I known very little about samba but it normally only takes me about 2 minutes to set up samba because I am a rather good copy an past monkey.


### ADDED TO BOTTOM OF smb.conf

# Synchronize Samba and Unix passwords
passwd program = /usr/bin/passwd %u
passwd chat = *password* %n\n *password* %n\n *changed*
unix password sync = Yes

passdb backend = tdbsam guest
guest account = smbguest
map to guest = bad user


### New and Improved Shamelessly Copy and Pasted Samba Script -
I got the commands from Eric's page
http://alien.slackbook.org/dokuwiki/...lackware:samba


The script:

#!/bin/sh
groupadd smbguest
useradd -g smbguest -m -d /home/smbguest -s /bin/false -c "Samba guest user" smbguest
smbpasswd -a smbguest -d
passwd smbguest -l

# General purpose:
mkdir -p /var/log/samba/messages
mkdir -p /usr/local/samba/bin
mkdir -p /usr/local/samba/netlogon
# A shared directory where you can dump stuff temporarily:
mkdir -p /usr/local/samba/share
chmod 1777 /usr/local/samba/share
# These are for the network printers:
mkdir -p /usr/local/samba/printers/{W32ALPHA,W32MIPS,W32X86,WIN40}
chgrp -R wheel /usr/local/samba/printers
chmod -R g+w /usr/local/samba/printers

chmod +x /etc/rc.d/rc.samba
/etc/rc.d/rc.samba start

smbpasswd -a smbguest -d

smbpasswd -a username<--- your user name goes here. You will be prompted for a password

## end



I name this script samba.setup
then I iissue:
chmod +x /wherever the scrip is/samba.setup (as root)

then I iissue:
sh samba.setup

Hope this helps
As always I welcome comments from my betters that will make this script better

Last edited by slackass; 07-10-2012 at 12:56 PM. Reason: oooops!
 
Old 07-09-2012, 06:28 PM   #3
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
I went through AlienBOB's stuff once already, I guess I could give it another shot. You mention that you added the first small section of your post to bottom of the smb.conf file; did you leave the rest of it as it is in default?
 
Old 07-09-2012, 06:40 PM   #4
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 890

Rep: Reputation: 78
Quote:
Originally Posted by spudgunner View Post
I went through AlienBOB's stuff once already, I guess I could give it another shot. You mention that you added the first small section of your post to bottom of the smb.conf file; did you leave the rest of it as it is in default?
Yes I did.
AlienBOB's stuff was the only one that was ever useful to me. I couldn't understand most of the others.

edit / note:
You can run the commands off one at a time and it will do the same thing.
I use the scrip because Its just faster for me during one of my "high speed bork, hose & reloads".

also:
All of those commands came right off AlienBOB's page.
http://alien.slackbook.org/dokuwiki/...lackware:samba

Last edited by slackass; 07-09-2012 at 06:50 PM. Reason: once again, oooooops!
 
Old 07-09-2012, 07:02 PM   #5
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 527
Blog Entries: 3

Rep: Reputation: 126Reputation: 126
Correct me if I'm wrong but if you want the Samba share to be discovered properly you need to start ntpd on the same box that Samba is running?
To start it
Code:
/etc/rc.d/rc.ntpd start
To start it every boot
Code:
chmod +x /etc/rc.d/rc.ntpd
 
Old 07-09-2012, 07:13 PM   #6
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 890

Rep: Reputation: 78
Quote:
Originally Posted by D1ver View Post
Correct me if I'm wrong but if you want the Samba share to be discovered properly you need to start ntpd on the same box that Samba is running?
To start it
Code:
/etc/rc.d/rc.ntpd start
To start it every boot
Code:
chmod +x /etc/rc.d/rc.ntpd
Hmmmmm.... I'm no one to be correcting anybody about computers but:
I have 6 boxes and 2 laptops that I setup with the above script and all can find each other.
However, I'll add:
/etc/rc.d/rc.ntpd start
chmod +x /etc/rc.d/rc.ntpd
to my little script if that will make it better.
Thanks!
 
Old 07-09-2012, 07:19 PM   #7
D1ver
Member
 
Registered: Jan 2010
Distribution: Slackware 13.37
Posts: 527
Blog Entries: 3

Rep: Reputation: 126Reputation: 126
Quote:
Originally Posted by slackass View Post
Hmmmmm.... I'm no one to be correcting anybody about computers but:
I have 6 boxes and 2 laptops that I setup with the above script and all can find each other.
However, I'll add:
/etc/rc.d/rc.ntpd start
chmod +x /etc/rc.d/rc.ntpd
to my little script if that will make it better.
Thanks!
You might want to wait for a confirm/deny from somebody with a little more clout. I just have this memory of bashing my head against smb.conf and then starting ntpd and everything suddenly working.
 
Old 07-09-2012, 07:37 PM   #8
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 890

Rep: Reputation: 78
Quote:
Originally Posted by D1ver View Post
You might want to wait for a confirm/deny from somebody with a little more clout. I just have this memory of bashing my head against smb.conf and then starting ntpd and everything suddenly working.
Yeah, I did my share of head bangin till I found AlienBOB's page.
 
Old 07-09-2012, 07:41 PM   #9
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 346

Rep: Reputation: 38
Quote:
Originally Posted by spudgunner View Post
So I've spent the last week trying to get a computer configured to operate as a server for my small home network of Windows 7 computers, and to be honest, it's been extremely frustrating. It took me ~5 days (starting June 30) just to get the Slackware computer to boot and since then I've been trying to get Samba working, to no avail. Yesterday I rage-quit and wiped everything I've done to the computer and decided that I really didn't need a home server...
@Spudgunner,

Do you still need help with this? I love using Slackware64 13.37 as a Samba server for windows clients because it takes less than 5 minutes to setup and its stable as an ox.

Let me know if you're still having trouble and I'd be glad to help you out.
 
Old 07-10-2012, 01:09 AM   #10
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-C ML
Posts: 890

Rep: Reputation: 78
@ spudgunner
As I recall, when I first starting using samba one major boo boo I did was having the same host name on some of my boxes and of course they couldn't find each other till I gave them all different host names.
All of my boxes are on the same domain name tho.
 
Old 07-10-2012, 01:50 AM   #11
vdemuth
Member
 
Registered: Oct 2003
Location: West Midlands, UK
Distribution: Slackware 14 (Server),Suse 13.1 (Desktop),, Mepis on the wifes lappy
Posts: 770

Rep: Reputation: 94
Want a nice easy way? Download and install Webmin and use it's inbuilt tools for setting up your server.
 
Old 07-10-2012, 03:04 AM   #12
rouvas
Member
 
Registered: Aug 2006
Location: Greece
Distribution: Slackware.12.2
Posts: 85
Blog Entries: 2

Rep: Reputation: 6
You don't need ntpd, you nmbd.

NTPD stand for Network Time Protocol Daemon, which is useful but not required for SAMBA shares.

Other than that, little can be done to help you if you don't post what you have done and what went wrong.
 
Old 07-10-2012, 04:29 AM   #13
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,504

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Quote:
Originally Posted by spudgunner View Post
Here is what I would like to accomplish:
1) The share itself will directory to which a hard drive dedicated to storage will be mounted to (which shouldn't be overly hard, but I think I may need help in getting file permissions correct)
2) The Samba share should be read/write for any Windows 7 PC that happens to connect to my LAN, complete with no authentication windows or configuration of Windows 7 computers needed. Access from the Windows 7 computers should be as easy as point and click.
that's pretty easy: let's assume you want your shared directory to be /home/samba
Code:
mkdir -p /home/samba
chown nobody:nogroup /home/samba
then go in /etc/samba, move away your smb.conf file (backup it somewhere), create a pristine one copying it from smb.conf-sample and edit it.
change the line
Code:
security = user
to
Code:
security = share
then, you will find in the same file this section
Code:
# This one is useful for people to share files
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = yes
uncomment it (copy it before, as you like), rename the share and make it point at your folder
Code:
[myshare]
   comment = My shared folder
   path = /home/samba
   read only = no
   public = yes
you can also add a line
Code:
   browseable = yes
if you want the share to be browseable through the network.

then
Code:
/etc/rc.d/rc.samba restart
and you're done

for more informations and details, as written on top of smb.conf-sample, see the Samba-HOWTO-Collection pdf or the Samba Guide (with many practical examples).

ntpd should be needed only if you want windows machines to join your samba domain and you use the samba machine as a domain controller with profile folders and stuff.

Last edited by ponce; 07-10-2012 at 09:02 AM.
 
Old 07-10-2012, 09:15 AM   #14
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 228

Original Poster
Rep: Reputation: 18
Thanks for all the awesome replies, it looks like I know what I'll be doing when I get home from work tonight!

@slackass: Please don't be offended, but I'll be giving your method a try after I try what ponce posted, only for the fact that his is much less complex. Whether or not I get his working, I'll be trying yours next because your (AlienBOB's) method allows for the creation of user-specific shares down the road, and I'd like to keep that option open. I am going to be leaving out all of the printer-related stuff though. None of my machines have the same host name and there no domain/domain controller to speak of (though I could make one, but I'd rather use dd-wrt that's on my router than the server box). I'm assuming that you use your Samba setup with Windows 7 computers on the network and it's all good (although since security=user still, I imagine you would have dialog boxes popping up on the Windows machines)? One more question, don't the lines
Code:
 # Synchronize Samba and Unix passwords
 passwd program = /usr/bin/passwd %u
 passwd chat = *password* %n\n *password* %n\n *changed*
 unix password sync = Yes
go in smb.conf and not in your script (did you make a mistake as to where you put ##end in your comment)? Thanks.

@thund3rstruck: Thanks for the offer of help, I'll give the methods that have already been posted a shot and if none of them work then I'll come-a-knockin'.

@vdemuth: Webmin looks like an awesome tool. If you or anyone else has used it, how has it been?

@ponce: I was so close to your solution! The only thing I immediately see that I missed was changing the ownership of the share folder and I used the [public] template rather than the [tmp] template. Just to be safe, once I make that directory, would I chown before I mount my storage device to it or after? Thanks.
 
Old 07-10-2012, 09:40 AM   #15
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,504

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
Quote:
Originally Posted by spudgunner View Post
Just to be safe, once I make that directory, would I chown before I mount my storage device to it or after? Thanks.
after, and if it already contains files/folder add a -R to the chown.
if your storage device is fat/vfat/ntfs formatted and you can't change the ownership (but you should also on those filesystem using mount options), you have to mount it with 777 permissions (ntfs-3g already does it).
 
  


Reply


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
[SOLVED] Creating a Samba-Server: Error: Password prompt pops up again and forever. VolvoxNo9 Linux - Newbie 4 12-23-2010 09:31 PM
8-bit-mime apparently not being advertised by SMTP server. hrfister Linux - Server 2 01-06-2010 10:28 PM
[SOLVED] Slackware64-C client wont detect Slackware64-C Samba server slackass Slackware 5 08-08-2009 12:23 AM
creating a sychronized suse server with windows server with ldap samba chars098 Linux - Server 0 06-17-2008 09:22 PM
How do I avoid creating lots of mount points? adrian_stephens Linux - General 5 04-16-2005 03:46 PM


All times are GMT -5. The time now is 10:31 AM.

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