LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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-10-2012, 09:23 AM   #16
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750

Quote:
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.
For that you should stick with the 'security = user' option.
To setup a share accessible by <user1> and <user2> but only writable by <user1> you can have settings like this
Code:
[Myshare]
   comment = My shared folder
   path = /path/to/share
   valid users = <user1> <user2>
   read only = yes
   write list = <user1>
Also remember that the Linux directory permissions take precedence over the Samba share permissions, so <user1> and <user2> would need to have access to the directory on which the share is mounted.
 
Old 07-10-2012, 09:44 AM   #17
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by ponce View Post
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).
I plan on having the drive be ext4 (and encrypted, but that shouldn't affect the file system at all)... does it have to be an MS readable/writable format in order for my Windows machines to use it? EDIT: Quick Google search says no, please correct me if this is wrong.

Quote:
Originally Posted by allend View Post
For that you should stick with the 'security = user' option.
That is what is suggested by AlienBOB's method, however I was under the impression that every time I access a share from a Windows computer a user/pass box would come up (and apparently Windows makes storing credentials difficult).

Last edited by spudgunner; 07-10-2012 at 09:50 AM.
 
Old 07-10-2012, 09:54 AM   #18
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
Does it have to be an MS readable/writable format in order for my Windows machines to use it?
No - I have Windows machines that write quite happily to shares on ext4 and reiserfs formatted partitions.
Quote:
however I was under the impression that every time I access a share from a Windows computer a user/pass box would come up (and apparently Windows makes storing credentials difficult).
You will need to provide credentials on initial connection. My experience is that Windows caches credentials and that it can be incredibly difficult to get Windows to forget cached credentials!
 
Old 07-10-2012, 10:29 AM   #19
slackass
Member
 
Registered: Apr 2006
Location: SE Texas
Distribution: Slack64-15.0
Posts: 910

Rep: Reputation: 90
[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
 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.

Your absolutely right! I did screw it up.
Thanks for pointing it out.

I guess it's time for me to start working on a
“New and Improved Shamelessly Copy and Pasted Samba Script”

Last edited by slackass; 07-10-2012 at 10:39 AM.
 
Old 07-10-2012, 10:46 AM   #20
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
Quote:
Originally Posted by spudgunner View Post
I plan on having the drive be ext4 (and encrypted, but that shouldn't affect the file system at all)... does it have to be an MS readable/writable format in order for my Windows machines to use it? EDIT: Quick Google search says no, please correct me if this is wrong.
no, it's right, ext3/4 will be ok, as they support POSIX ACLs (more on this).

EDIT: ah, missed this
Quote:
Originally Posted by spudgunner View Post
I plan on having the drive be ext4 (and encrypted, but that shouldn't affect the file system at all)
sorry, if I'm not too curious, which is the point of encrypt it if anybody in your network can mount it?

Last edited by ponce; 07-10-2012 at 12:15 PM.
 
Old 07-11-2012, 06:44 AM   #21
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
In case someone decides to walk off with it.
 
Old 07-11-2012, 07:18 AM   #22
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 386

Rep: Reputation: 43
Quote:
Originally Posted by allend View Post
You will need to provide credentials on initial connection. My experience is that Windows caches credentials and that it can be incredibly difficult to get Windows to forget cached credentials!
Actually this isn't entirely true, at least not for professional versions of Windows. There is a Group Policy that manages cached passwords and machines on a domain almost always have the domain policy set to never cache credentials.

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)
 
1 members found this post helpful.
Old 07-11-2012, 10:34 AM   #23
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
There is a Group Policy that manages cached passwords and machines on a domain almost always have the domain policy set to never cache credentials.
Just goes to show my lack of experience! Thanks for that as it is something for me to look into.
 
Old 07-11-2012, 11:36 AM   #24
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 386

Rep: Reputation: 43
Quote:
Originally Posted by allend View Post
Just goes to show my lack of experience! Thanks for that as it is something for me to look into.
No problem I just checked my notes and here's what I've got:

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?
 
Old 07-11-2012, 12:57 PM   #25
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by thund3rstruck View Post
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.
I never planned on using NTFS for my file server because I know it can cause problems sometimes and isn't native.

Quote:
Originally Posted by thund3rstruck View Post
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)
I don't plan on passing movies/TV shows through a media server (unless you count a PS3 as a media server). I'm actually looking to do this without creating any accounts for the purpose of Samba shares right now (although this will probably change in the future as I become more familiar with Samba). Ideally, I would like my wife's PS3 to be able to access the share for TV/movies, but (at least in my experience) the PS3 is a real pain to deal with and I hate it, so I won't count it as a loss if it can't read the Samba share.
 
Old 07-11-2012, 01:45 PM   #26
thund3rstruck
Member
 
Registered: Nov 2005
Location: East Coast, USA
Distribution: Fedora 18, Slackware64 13.37, Windows 7/8
Posts: 386

Rep: Reputation: 43
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]
        comment = Video Server
        path = /media/share/disk2/Videos
        read only = No
        create mask = 0775
        guest ok = Yes
Ensure no obvious errors occurred:
Code:
testparm

# if all is ok, restart samba
/etc/rc.d/rc.samba restart
In windows do: Start > Run > \\IpAddress

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)
 
Old 07-13-2012, 07:31 AM   #27
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
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.
 
Old 07-14-2012, 12:29 PM   #28
spudgunner
Member
 
Registered: Dec 2009
Distribution: Slackware
Posts: 229

Original Poster
Rep: Reputation: 20
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!
 
Old 07-14-2012, 04:47 PM   #29
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
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.
Attached Files
File Type: pdf Samba-HOWTO.pdf (116.7 KB, 45 views)
 
Old 07-14-2012, 09:03 PM   #30
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by thund3rstruck View Post
No problem I just checked my notes and here's what I've got:

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?
You can also manage stored passwords on windows by doing the following.

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.
 
  


Reply



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 08:31 PM
8-bit-mime apparently not being advertised by SMTP server. hrfister Linux - Server 2 01-06-2010 09:28 PM
[SOLVED] Slackware64-C client wont detect Slackware64-C Samba server slackass Slackware 5 08-07-2009 11:23 PM
creating a sychronized suse server with windows server with ldap samba chars098 Linux - Server 0 06-17-2008 08:22 PM
How do I avoid creating lots of mount points? adrian_stephens Linux - General 5 04-16-2005 02:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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