Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to get samba to work properly... I have a "Movies" share (//server/Movies), I want only root account to be able to upload and delete. Guest can view "Movies" share without password/login but they cant delete/update (only view).

[Movies]
        path = /mnt/user/Movies
        browsable = yes
        public = yes
        writable = no
        write list = root
        guest ok = yes

I can access to Movies share as guest but when I try to add new file I get an error saying: "You need permission to perform this action"

I expected username/password to popup but it didn't, how to fix this?

share|improve this question

3 Answers 3

Nothing to do with Samba, I'm afraid. You already authenticated as Guest from the Windows machine. To log in as root try to map the disk drive. That should overwrite authentication.

share|improve this answer
    
The mapping a drive as another user was a problem a few years ago with Samba. I.E. a station/host could only use one set of credentials ... the ones you logged in with. Has this problem been fixed? If not then then the only solution would be to logout and then login as root to gain the root privs. –  mdpc Jul 28 '11 at 2:17
    
It doesn't have to be Samba. You cannot log in to the same smb machine with more than one set of credentials. –  R.Starikov Jul 28 '11 at 4:33
    
I can access to /mnt/user/Movies without credentials... that work fine.. when I accept to copy file or write - expected credentials to popup but it did not.. how to fix this? –  user88432 Jul 28 '11 at 9:25
    
To R. Starikov...what I mean is that a windows workstation already mapped to a samba share was unable to map another share on that same host using a different username which is an option on either net use or when mapping a drive via the file explorer. –  mdpc Jul 28 '11 at 22:59

When you initially access (map/mount/...) the share, you provide a username. Any further access is then performed with this username. To change the account you would need to stop the connection and restart the access.

The popup privilege-escalation pop-up you think of: here is no such functionality inside Windows.

Sorry.

BTW: do you know that you can map Windows usernames to Linux/Samba usernames and that it is not a good idea to give someone root access via Samba?

share|improve this answer

The problem is that your initial post didn't specify a security mode for Samba. You've just given the share definition. The two interact, but one is not the other.

A security mode describes HOW your clients will authenticate. This also means that, if you fail to make a working model, typically most installations will default to either guest or nobody as the user you are mapped to. If it is set up correctly, your remote credentials are mapped to a local user, a mapped user account stored in the samba back-end, or some other mapping (typically used with Active Directory), depending on how you have this set up. That mapping dictates who you present yourself as when accessing the share.

The share definition dictates what is shared to whom in the context of the security mode. Now that you have (or haven't) authenticated yourself, the resulting identity is compared to what is specified for the share definition; access to the share is granted in varying degrees based on what the definition says.

In order to fully diagnose what is happening, we would need to see the entire smb.conf file. I would suggest typing out

testparms > results.smb

and copying the contents of results.smb to your posting, so everyone can see what is happening.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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