Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have two samba shares. One a public (local network) that anyone can see and change, this works great. I have another share that I want the username and password to be entered

[media]
   comment = public share
   path = /mnt/media_files
   public = yes
   read only = no
   writeable = yes
   create mask = 0777
   directory mask = 0777
   force user = nobody
   force group = nogroup
   guest ok = yes

[webroot]
   comment = Apache web root folder
   path = /var/www
   public = yes
   read only = no
   writable = yes
   create mask = 0777
   directory mask = 0777
   guest ok = no

I did have "force user = jon" as well but didn't seem to help.

The issue I have at the moment is that when I go to the share "\myip\webroot" I get the popup asking for the password, but the username is grayed out with "ip\Guest". How can I get it to either allow me to enter the username, or force it to just use "jon".

loging in from Windows7 machine seems to work better after fixing an issue with the smpasswd part. I set the password the same as my username accuont on W7 machine and all was good. Has a bit of an issue from other machines have to login with ip\jon otherwise it sets the domain to be the name of that computer.

TestParm output:

[global]
    server string = %h server (Samba, Ubuntu)
    security = SHARE
    map to guest = Bad User
    obey pam restrictions = Yes
    passdb backend = tdbsam
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
[media]
    comment = public share
    path = /mnt/media_files
    force user = nobody
    force group = nogroup
    read only = No
    create mask = 0777
    directory mask = 0777
    guest ok = Yes
[webroot]
    comment = Apache web root folder
    path = /var/www
    valid users = jon
    force user = jon
    read only = No
    create mask = 0777
    directory mask = 0777
    guest ok = Yes
share|improve this question

closed as too localized by jrg, Bruno Pereira, Marco Ceppi Dec 5 '11 at 17:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
May you post the result of testparm (its shows all config values that are not default) –  aatdark Sep 10 '10 at 23:41
    
added testparm, thx didn't know about that. –  Jon Sep 11 '10 at 22:02
    
This question is abandoned - if you feel this is in error, then please flag explaining why and the moderators will re-open it. –  jrg Dec 5 '11 at 17:00
add comment

1 Answer 1

Ok i'm not quite sure if i got your intended setup right. But i would try this one:

[global]
...
security = user
guest account = jon

[webroot]
comment = Apache web root folder
path = /var/www
read only = No
create mask = 0777
directory mask = 0777
guest ok = Yes

If i provide no password for webroot => i'm jon
If i logon i'm the user that has logged on (don't forgett smbpasswd for every unix user you want to enable samba access.

share|improve this answer
    
if I set security to user for global will that not stop the media share being publicly accessable to guests, (on local network). Thx –  Jon Sep 12 '10 at 11:49
    
no, guest access was still possible on my testsystem (ubuntu lucid). But i have to admin i haven't tested with a windows client. (only linux) –  aatdark Sep 13 '10 at 22:02
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.