LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-19-2008, 07:19 PM   #1
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Rep: Reputation: 15
samba usershare max shares


Running ubuntu 8.04 and Samba version 3.0.28a.

I'm trying to restrict the number of directories users can share with the "usershare max shares" option.

I set it to 3 but I can still share directories with 10 files in them from my windows machine (XP).

Here is smb.conf.

Code:
[global]
    wins support = yes

    netbios name = MY_GATEWAY
    server string = MY_GATEWAY
    workgroup = WORKGROUP
    socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

    passdb backend = tdbsam

    security = user
    encrypt passwords = true
    invalid users = root

    map to guest = bad user
    guest account = nobody

    interfaces = lo, eth1
    bind interfaces only = true

    syslog = 1
    syslog only = yes

    dns proxy = no

    usershare max shares = 3

[Media]
    path = /home/ftp/
    read only = yes
    create mask = 0640
    directory mask = 0750
    guest only = yes
    guest ok = yes
I ran testparm on my smb.conf and the syntax is correct.
 
Old 10-19-2008, 07:43 PM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Are you trying to restrict the number of directories or the number of files - you refer to both above?

Usershare max shares = "Maximum number of user defined shares allowed." (from man smb.conf)
 
Old 10-20-2008, 11:00 PM   #3
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Original Poster
Rep: Reputation: 15
Ok thanks.

I have a different problem now. I have two machines, the linux machine with samba and a windows xp machine as a client.

On my windows machine when I browse Workgroups I can see the linux machine and myself. I can also see all the shared folders in My Network Places.

From the linux machine when I do a findsmb it only lists the linux machine, not the windows machine. But when I do a smbtree it shows all the shared directories from the linux and windows machine.

I don't have a second client computer to test with, but wouldn't the second client not be able to see the windows machine because it's not listed on the server?
 
Old 10-20-2008, 11:07 PM   #4
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
For me, findsmb finds the host linux box I run it from plus a networked printer(!). smbtree gives the type of response I'd expect (samba shares plus windows shares). I suspect this is because I have port 445 closed, but that's just a guess.
 
Old 10-20-2008, 11:16 PM   #5
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Original Poster
Rep: Reputation: 15
Ok, but I have the entire interface open, no closed ports and I still get only the samba server showing up for findsmb.

Also after further testing, when I restart the windows machine and execute a smbtree on the linux machine, it lists all the linux and windows shared directories. After a few minutes, it sometimes doesn't see the windows directories anymore.

The samba server times out names after six days so why are the directories sometimes dissapearing after a few minutes.

I have file and folder sharing allowed through windows firewall.
 
Old 10-20-2008, 11:24 PM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I'm afraid I can't help you there. I was taking a stab at the findsmb result. It's not a facility I use.
 
Old 10-21-2008, 06:00 PM   #7
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Original Poster
Rep: Reputation: 15
Let me clarify my questions, they may have been confusing.

The windows machine can see and download all the shared folders from the linux machine, and the linux machine can download from the windows machine with smbclient.

However, when I issue "findsmb" the linux machine only reports itself, not the windows machine. The man pages show it printing a list of machines for the entire network. Why is findsmb not listing the windows machine?

Even though file and printer sharing is enabled in windows firewall findsmb still doesn't list the windows machine. I also tried disabling windows firewall, still nothing. I allow all traffic to my linux machine from lan interface (currently).

Secondly, smbtree doesn't always return consistent results. When I restart my windows machine and do a smbtree from the linux machine, all of the shared folders for linux and windows are listed. Then a few minutes later smbtree may only list linux shared folders. It seems inconsistent, is this normal?

smbstatus seems to work. When I'm connected to a linux shared folder smbstatus lists the connection.
 
Old 10-21-2008, 06:56 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
I understood what you were saying, but I get a similar response - ie findsmb doesn't see my windows boxes either - it just finds the server and a printer. Probably a Windows setting, but I really don't know. Yes, smbtree shows windows shares. Sounds like an findsmb issue to me rather than your system.
 
Old 10-24-2008, 01:14 PM   #9
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Original Poster
Rep: Reputation: 15
I made samba a domain master and added it as a netbios server in dhcpd.conf and I'm still having the same problem.
 
Old 10-27-2008, 08:39 PM   #10
Shwick
Member
 
Registered: Jun 2008
Posts: 111

Original Poster
Rep: Reputation: 15
Someone on IRC said "that depends if the windows server is advertising on netbios, and what the permissions are on the share". Well the permissions on the windows share allow it to be downloaded, I have "share this folder on the network" checked.

I also have file and printer sharing allowed through the firewall. Still not sure why it isn't showing up.
 
  


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
how to restrict max folder size on nfs shares?? j4jaybi Red Hat 1 07-28-2006 12:32 PM
Linux can mount samba shares but not windows shares bindsocket Linux - Software 1 12-01-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:41 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