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! |
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” - :D 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 :) |
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?
|
Quote:
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 |
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 Code:
chmod +x /etc/rc.d/rc.ntpd |
Quote:
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! |
Quote:
|
Quote:
|
Quote:
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. |
@ 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. |
Want a nice easy way? Download and install Webmin and use it's inbuilt tools for setting up your server.
|
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. |
Quote:
Code:
mkdir -p /home/samba change the line Code:
security = user Code:
security = share Code:
# This one is useful for people to share files Code:
[myshare] Code:
browseable = yes then Code:
/etc/rc.d/rc.samba restart 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. |
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 @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. |
Quote:
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). |
Quote:
To setup a share accessible by <user1> and <user2> but only writable by <user1> you can have settings like this Code:
[Myshare] |
Quote:
Quote:
|
Quote:
Quote:
|
[QUOTE=spudgunner;4723891]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 Your absolutely right! I did screw it up. Thanks for pointing it out.:doh: I guess it's time for me to start working on a “New and Improved Shamelessly Copy and Pasted Samba Script”:D :D |
Quote:
EDIT: ah, missed this Quote:
|
In case someone decides to walk off with it.
|
Quote:
I always just create the same accounts on all the machines on the network. As long as user1/password1 exists on the windows machines and the Samba server you don't need to provide a password when connecting to the share. Also, I wouldn't recommend formatting the disks in NTFS on the Samba server because that relies on the NTFS-Fuse drivers instead of the native linux filesystem. I do, however, format an external USB disk to NTFS as I use that for rsync backups and I want my USB backups readable by any PC. Also, if you are using this SAMBA server to feed a media center (like XBMC) then I highly recommend setting the guest ok = yes setting on your Movies/TV share. If you do this then you don't need to create an account on the samba for the media center and everyone on the network has read access to your videos (without a password). Media centers should never have write access anyways (some of them like to delete watched videos) |
Quote:
|
Quote:
Disable password caching: Group Policy -> Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Local Policies -> Security Options: Network access: Do not allow storage of credentials or .NET Passports for network authentication Set to Enabled This will disable the "remember my password" option from both Internet Explorer and File Shares. This is the local policy. I can dig around for the domain policy if you'd like? |
Quote:
Quote:
|
You're right the PS3 (and X360) are absolutely awful as media players. If you absolutely have to stream to PStriple, then give a go with MediaTomb (http://slackbuilds.org/repository/13...dia/mediatomb/).
It's really such a shame that the XBMC was born from the original XBOX and Microsoft did such a pitiful job copying it. XBMC is an absolute masterpiece though, especially coupled with SickBeard PVR, CouchPotato, and Headphones.... but I digress.. :) Back to business, to open the server up read-only just take a vanilla Slackware installation (be sure to enable Samba server when the Slackware installer asks you what services to start or just chmod +x /etc/rc.d/rc.samba). Then edit /etc/smb.conf and add a definition like this: Code:
[Video] Code:
testparm And you should see the share. You can't write to it yet. Once you get here, we can walk through creating samba users and mapping them to local Linux users. At this stage you'll also want to enable ACLs so all your users can read, write, and delete all the files (instead of constantly having to chmod or apply suid bits) |
Man guys, all this awesome help and I haven't had time to actually do anything yet, it makes me feel bad. I'm going to do my best to get this thing working this weekend.
|
Just got the very basic server working with Ponce's config advice, thanks to all those who helped! I'm marking the thread as solved, but I'll probably be back looking on how to create a server that's a little more advanced (multiple shares based on users, etc). Thanks a ton guys!
|
1 Attachment(s)
I've written a short (four page) documentation about Samba. This is actually the configuration I use when installing a server for clients (not the machines, but the real people clients). It's taken quite some RTFM and experimenting, but right now it works perfectly. It's in French and it's written for Debian, but the smb.conf is distro-agnostic. I've attached it here, since it's in PDF format. Heavily inspired by AlienBOB and book authors Carla Schroder and Michael Kofler.
Enjoy. |
Quote:
Open "run" and enter "control userpasswords2" That'll bring up a window, hit the advanced tab and choose "Manage Passwords" You'll be able to manage (edit|add|delete) the user/pass combo for each machine. |
All times are GMT -5. The time now is 03:15 AM. |