LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 01-08-2009, 10:50 PM   #1
DarkFlame
Member
 
Registered: Nov 2008
Location: San Antonio, TX, USA
Distribution: Ubuntu Server 8.10 & SAMBA 3.2.3
Posts: 158
Blog Entries: 1

Rep: Reputation: 30
Samba: net usershare command, and requesting an example from smb.conf


Ubuntu Server 8.10 with Samba (not sure how to figure out which version, but it's only been a couple of days since I did:
apt-get install samba
and it's apparently working, at least to some extent.

My server is without GUI, and I'm trying to do everything using the CLI and NOT install any kind of GUI - no Webmin and especially no desktop.

Plus, I'm running it virtually headless (not "actually" because I've still got a monitor and keyboard and mouse - whatever purpose THAT serves! but "virtually" because I'm doing everything remotely from my WinXP Pro desktop using PuTTY, and I'm not looking at the server monitor, which has timed out and turned off).

I have managed to get my RAID5 array mounted, and I'm able to see the folders & files when I'm logged in using PuTTY.

I have created the users, both in Linux and in Samba, and both have the same username & password.

I am trying to create the shares using
net usershare add DATA /NW-DATA/DATA Network-Data david:f guest_ok=n
  • where "DATA" is the name that I want to appear when viewing the Microsoft Windows Network,
  • /NW-DATA/DATA is the folder (and all sub-folders) that I want to see when I look at "DATA" from the Windows machines,
  • [Network Data] is the comment, david:f is the acl where david is to have full read/write rights,
  • and guest_ok=n means that guests cannot use it.
  • All this is assuming that I understand the "net usershare" command
When I enter the command, it comes back to the command prompt. I am now able to SEE "data" in my Microsoft Windows Network, but can't get into it. So, I'm wondering, Did I enter the command correctly?
Also, if someone has an example from smb.conf of a folder they're sharing, that'd go a long way to helping me. I HAD one, but apparently failed to move the data cable when I did a full installation of Ubuntu 8.10 - so, instead of installing on a blank drive, I installed on a drive I'd gotten running by copying a section from my OpenSuSE OS HDD, but my OpenSuSE OS HDD is the one that's blank (I blanked it with the intent of doing the second Ubuntu install on it while I kept the first one exactly for this purpose. Me thinks me screwed me self!

Tomorrow, we're running to the bookstore & I'm going to see if they have something worthwhile on Samba. I've already exhausted Linux for Dummies and The OpenSuSE Bible, neither of which are much help as both re oriented toward GUI use.

Any help is appreciated.
 
Old 01-08-2009, 11:08 PM   #2
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Something like this?

Code:
[spare]
        comment = Spare drive - not backed up
        path = /storage2/samba
        browseable = yes
        writable = yes
;       valid users = %S
;       valid users = MYDOMAIN\%S
        create mode = 664
        directory mode =775
        vfs object = recycle
                recycle:repository = .deleted
                recycle:touch = yes
                recycle:versions = yes
                recycle:maxsize = 0
                recycle:exclude = *.tmp
                recycle:exclude_dir = /tmp
                recycle:noversions = *.doc
Note - you don't need any of the vfs object stuff

Also note that "man smb.conf" is very useful. In the above, it would be "guest ok = no" in the share definition

Last edited by billymayday; 01-08-2009 at 11:11 PM.
 
Old 01-09-2009, 07:42 AM   #3
DarkFlame
Member
 
Registered: Nov 2008
Location: San Antonio, TX, USA
Distribution: Ubuntu Server 8.10 & SAMBA 3.2.3
Posts: 158
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Billy,

That looks pretty good. I'm picking up a book on Samba this morning, so I'll have a bit more reference. I'll let you know what I end up with. My smb.conf does not have a [share] section, yet, so I've got to insert that, too.

I HAVE inserted most of the text you've provided - with changes reflecting my system.

I'll post what works when I've got it done.

THANKS,
David
 
Old 01-09-2009, 02:12 PM   #4
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Have you looked at the docs on www.samba.org? They're pretty comprehensive.


BM
 
Old 01-09-2009, 02:38 PM   #5
DarkFlame
Member
 
Registered: Nov 2008
Location: San Antonio, TX, USA
Distribution: Ubuntu Server 8.10 & SAMBA 3.2.3
Posts: 158
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Bill,

I have definitely looked at some of the Samba.org instructions. The problem is mine - I'm either too busy dealing with the kids in the morning, or too tired in the evenings, to be able to - within my realm of patience - find what I need, implement it, test it, and confirm that it works or try something else. Finding it, and recognizing that I've found it, is usually the hard part. That's why a book does me worlds of good - I can read it during the work day when I'm taking a few minutes break, and it's uninterrupted concentration time.

The bookstore had no Samba books, but did have almost a dozen different ones I could order (& wait weeks to get). However, they had Linux Administration - A Beginner's Guide - Fifth Edition, which I purchased because it had some decent looking sections on sharing and users and permissions (as well as hardening a server), and most of it had comprehensive CLI syntax that looks like I can use it. They had another that was comprehensive to Ubuntu, but only a very small section on the Server, and even that was GUI oriented - it came with a DVD and was $15 more expensive, so I didn't figure it would provide 25% more value! Maybe when I get to installing Ubuntu on our desktops, it'll provide more value. But, for the moment, I went with the more generic book - it's more in-depth than the "For Dummies" book that I got.

And, speaking of strictly Linux, is there that much difference in how the Kernels work? I mean, I understand that the server version is better for that purpose, and the desktop version comes with a GUI. And, I understand that different distros have their own agendas of releases & how they follow-up to fix bugs (or don't). But, the core of the Linux kernel is essentially the same from one version to another, and Samba is equally consistent. Is that a reasonably true assumption?
 
Old 01-09-2009, 02:52 PM   #6
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I recall seeing an article on the difference between server and desktop kernels for Ubuntu, but honestly can't recall what they were. it's not a difference kernel as such, just that they compile it with different options. If you ever feel the urge to compile your own kernel, you'll find that you can select what drivers to support, what filesystems, memory models, etc to activate. This is what they mean. Different kernel versions include bug fixes, new drivers (the latest supports the ext4 filesystem for example).

Tell me, what are you trying to do with samba exactly?
 
Old 01-09-2009, 04:45 PM   #7
DarkFlame
Member
 
Registered: Nov 2008
Location: San Antonio, TX, USA
Distribution: Ubuntu Server 8.10 & SAMBA 3.2.3
Posts: 158
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by billymayday View Post
Tell me, what are you trying to do with samba exactly?
Bill, in a nutshell, I'm trying to learn enough about Samba that I'm able to do complete administration from the command line. That's a big task, I know, like learning DOS when all I know is French (I know far more DOS than French, but that's the idea). That's the big picture. Specifically, I want to be able to use the CLI to create shares & then to create users within groups that have RW access to some folders, RO access to other folders, and not even able to browse other folders.

I figure that if I can do it with the CLI, then I'll have a pretty good understanding of the nuts & bolts of the system. I'd like to be as fluent in Linux & Samba as I am in DOS & Windows.

Big task, I know. But, I'm "konquering it one task at a time!"
 
Old 01-09-2009, 05:21 PM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Just remember - Linux permissions trump Samba permissions, so if a user or group doesn't have directory/file access at the Linux level, it won't matter what you tell Samba to do.

ie, it you are connecting as user david, group users, but the directory is owned by root:root with 700 permissions, Samba won't be able to force a read or write of that directory.

Also, SELinux can be an issue with Samba if you are using it. If so, remember to check audit logs.

When you say using the command line, I assume you're just editing smb.conf?
 
Old 01-09-2009, 10:39 PM   #9
DarkFlame
Member
 
Registered: Nov 2008
Location: San Antonio, TX, USA
Distribution: Ubuntu Server 8.10 & SAMBA 3.2.3
Posts: 158
Blog Entries: 1

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by billymayday View Post
Just remember - Linux permissions trump Samba permissions, so if a user or group doesn't have directory/file access at the Linux level, it won't matter what you tell Samba to do.
That is good to know. I didn't figure that there were overlapping jurisdictions, but it sounds like they are and that Linux takes precedence over Samba. This leads me to ask the question: Is there a way to share files to Windows desktops without using Samba (or another, similar, type of package)?


Quote:
Originally Posted by billymayday View Post
Also, SELinux can be an issue with Samba if you are using it. If so, remember to check audit logs.
You mentioned this to me previously, and I looked at the file (I'd have to look back at that thread/post to see which one), but I couldn't tell you that I recognized anything from SELinux - not that I'd recognize it if it was printed on my eyeglasses!!!

Quote:
Originally Posted by billymayday View Post
When you say using the command line, I assume you're just editing smb.conf?
Actually, no. I'd PREFER to issue commands from the prompt and let them put the information where it belongs. It is good, however, to look into smb.conf (& other files such as etc/passwd, /etc/shadow, bashrc/.profile, /etc/group - just to name a few) to see the changes the commands make. Among the commands, I'd like to use useradd, userdel, usermod, groupadd, groupmod, & groupdel. And, as I'm guessing you are understanding, these are just the ones I've read about today. If I can get away without modifying any files directly, I'd rather be able to do that because it means I'll have a strong grasp of the commands, and I'd be able to learn the editing of smb.conf (& the other files) by seeing how it/they change as I use the commands.

And, here's the most important part: I'm making a document so that I'll be able to rebuild the server quickly and efficiently. It'll be easier for me to do that with instructions centered around the commands & not the editing. Plus, in the event of a true disaster when my wife might have to rebuild the server (& she hasn't got the grasp of technology that I have). She'd be easier able to execute the commands than to edit the files manually (she follows a recipe pretty well, and that's how easy I want my instructions to be, and that's what I've managed to accomplish - so far).

Aaah, the weekend is here. I'll have more time to read and work through this!
 
Old 01-26-2009, 10:01 AM   #10
chitambira
Member
 
Registered: Oct 2008
Location: Fife
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 49
Im guessing you wanted the NET USE command; check http://www.ss64.com/nt/net_use.html
 
  


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
samba usershare max shares Shwick Linux - Server 9 10-27-2008 08:39 PM
Samba in Debian, smb.conf: smb passwd file = ?????????? henrnorl Linux - Software 1 10-06-2006 09:43 AM
Samba + smb.conf help. jwholey Linux - Software 1 07-05-2006 11:25 PM
Reinstalling Samba doesn't recover the original /etc/samba/smb.conf Akhran Debian 2 11-11-2005 12:54 AM
samba conf smb.conf regnier Mandriva 5 02-17-2005 04:27 AM


All times are GMT -5. The time now is 12:39 PM.

Main Menu
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