LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-02-2005, 05:51 PM   #1
craig467
Member
 
Registered: Jun 2005
Location: Maine
Distribution: Red Hat 9
Posts: 65

Rep: Reputation: 15
Samba - Share definition on a folder under a home directory


I have set up samba to the best of my abilities (new at Linux - Red Hat Linux 9 is what I am starting with) and I believe it is running correctly - I can see the Windows2000 machine's shared folders from Linux and I can see the shared folders on Linux from Windows. I think that I just need a little explanation that I am doing this correctly.

The issue I am wondering about is that I wish to share a folder "docs" (/home/craig/docs) on the Linux machine without sharing the contents of "craig" (/home/craig), is that possible?

My understanding was that if you shared a specific folder located on the Linux box, that folder would be the only one available to be seen and explored on the network. What I am finding, is that I not only have the "docs" folder displayed in the \\workgroup\Localhost listing, but also its parent folder ("craig")and all of "craigs" contents including the "docs" folder displayed - "docs" and "craigs" show up as 2 separate entities.

However, I noticed that if I share a root folder like /tmp, that works fine and does not allow the contents of the root directory ("/") to be seen in the Windows Neighborhood.

My smb.conf file share section reads:

[homes]
comment = Home Directories
browseable = no
writeable = yes
valid users = %S
create mode = 0664
directory mode = 0775

[docs]
comment = Craigs docs
path = /home/craig/docs
writeable = yes
valid users = craig
printable = no

[tmp]
comment = Root Temp directory
path = /tmp
writeable = yes

The only thing that I tried was to comment out the [homes] section. This seemed to get rid of the home directories and leave me with just the directories that I have specified.

Is it really bad to do this? It seems to restrict users from looking at all files within their own user home files (ones that are not specified), including the hidden ones. It also seems to remove the names of the users on the network. Do you want all users names or home files on the Linux machine to be viewed by others on the network? Are there any pluses or minuses to all this?

Thanks for any help with this, I hope it is not to many questions for one posting, but they all seem interrelated to me. Thanks again.

Craig

Last edited by craig467; 06-02-2005 at 05:52 PM.
 
Old 06-02-2005, 07:42 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
[homes] is special i.e. samba automatically creates a home share for all valid users with the name of the shared directory as the username.

The home share is only visible and accessable by that user. Your the only valid user for docs so I am not sure why you want it as a seperate share except for maybe a shortcut. The point IMHO of having a home directory on a server is that a client can access data from any workstation on the network and it is hopefully backed up on a regular basis.

You can find documentation for samba at www.samba.org
 
Old 06-03-2005, 05:27 AM   #3
craig467
Member
 
Registered: Jun 2005
Location: Maine
Distribution: Red Hat 9
Posts: 65

Original Poster
Rep: Reputation: 15
Thanks for responding and I see your point about making files available. I guess a follow up point to my first question would be that it makes sense to see files like you would on you home directory, but why would you want "system files" and files that you do not create like the .bash history files and folders like .gnome, .mc, .moilla ... etc.

I would think that all you would want to appear on the network would be the files that you create. Is there a way to limit the files on the network to appear as they do when, on the Linux machine, you are looking at your home directory?

P.S. Thanks again for the help and thanks for the link I will check that out today.
 
Old 06-03-2005, 07:55 AM   #4
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
why dont u create a group of users and assign them the permission which is not even read only in my opinion this should work in the way you want
 
Old 06-03-2005, 06:03 PM   #5
craig467
Member
 
Registered: Jun 2005
Location: Maine
Distribution: Red Hat 9
Posts: 65

Original Poster
Rep: Reputation: 15
bramhastra,

I am not really sure what you mean by this. i know how to create groups, but what about the permissions?
 
Old 06-03-2005, 10:18 PM   #6
mhearne
Member
 
Registered: Nov 2004
Location: Amarillo, TX
Distribution: Mandriva
Posts: 91

Rep: Reputation: 15
The simplest thing is to create a new Documents directory (chmod -R 777) (chown -R root.users) and place what you want to share there. Make sure that all your users are members of the "users" group.

Then add the following to smb.conf:

[Documents]
comment = Public Documents
path = /home/samba/public/Documents
public = yes
browseable = yes
writeable = yes
valid users = @users
printable = no

HTH

Michael

Last edited by mhearne; 06-03-2005 at 10:27 PM.
 
Old 06-04-2005, 03:54 AM   #7
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
Well what i said was create a group of the user you want to assign certain permission on the file or folder. This would make your work simpler
 
Old 06-04-2005, 04:04 PM   #8
mhearne
Member
 
Registered: Nov 2004
Location: Amarillo, TX
Distribution: Mandriva
Posts: 91

Rep: Reputation: 15
I'm not sure what you mean by creating a new group for users. If you mean that you would want to exclude some and allow other users, you would do that in smb.conf with:

"valid users = user1 user4 user5 ...".

Craig wants to share folders between Linux and Win2k. To do this without Samba he would need to use nmb (nfs). While nfs, is built in to Linux, since it is open source, you have to purchase it for Windows.

IOW, it isn't free. The most popular client is Hummingbird http://www.hummingbird.com/products/nc/nfs

To share a folder between Linux machines, all you have to do is right click on the folder (not on the desktop, but in your home directory). Click on properties and go to the tab marked "Local Net Sharing". Click on "shared" and then click on "Configure File Sharing".

Then it's on to "Allow all users" or "Custom" and you're set. But this only works between Linux machines.

Since I don't want to buy server software just for my Notebook, I just use Samba, since it's already there.

Michael
 
Old 06-06-2005, 06:57 PM   #9
craig467
Member
 
Registered: Jun 2005
Location: Maine
Distribution: Red Hat 9
Posts: 65

Original Poster
Rep: Reputation: 15
bramhastra and Michael,

Thanks for the great info! I think I will stay with samba because it is free. Are there pluses to using nfs? What are the differences between the 2 (samba and nfs) other than cost for nfs on Windows?

Thanks again for all the help.

Craig
 
Old 06-07-2005, 03:29 AM   #10
bramhastra
Member
 
Registered: May 2005
Location: India
Distribution: RHEL 4.0
Posts: 136

Rep: Reputation: 15
well nfs provides a better management facility and it mounts the remote file/directory so as you are working on your machine only. These are a few general points. There are technical differences also
 
  


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
Default Share / Home folder problem Seventh Linux - Newbie 3 06-29-2005 03:05 PM
Samba :share files from home directory to an other user flashdelux Linux - Software 0 11-29-2004 12:57 PM
Share /home Directory aeruzcar Linux - General 5 09-02-2003 07:50 PM
Can I share my /home directory.. GhostInDarkness Linux - Newbie 7 08-28-2003 03:02 PM
Share home directory cruella Linux - Newbie 4 01-22-2002 01:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:36 PM.

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