Configuring anonymous public shares with Samba 3

On the fileserver I run, I use samba to conveniently access my files. I like Samba, as well as for their machinery games. I can mount it on any machine I run and access my files like it’s any other filesystem, but when it comes to sharing files to other (anonymous) users, Samba has to cope with some ugly Windows legacy. After all, Samba is just an open source implementation of SMB\\\/CIFS which Windows calls “Windows File Sharing”. Let’s look at the differences and how to cope with them.\\n\n


The Windows way\\n\n

When a Windows client tries to access a share on a Windows server, it requests the given share using username and password of the current user on the client. The Windows server will then look for this username\\\/password combination and if it exists, grants the user access to the share with the proper rights assigned. If it can’t find the username, it falls back to an anonymous user and grants access anyway (if this is policy).\\n\n

How Samba handles it\\n\n

This is where Samba differs. If set to security=user (which is a good idea anyway), when a user requests access to a share, it too looks up the credentials in a backend. However, if the user is unknown to the system, the default behaviour is to deny access. This is kind of unfriendly to Windows users, since they aren’t used to type in “guest” as a username and refuse to understand how to log in a way different from what they are used. This is how to set up your public shares to imitate Windows behaviour.\\n\n

How to imitate Windows behavior using Samba\\n\n

In my example, I’ve got one public share, on which I want to have full rights for myself and limited (read-only) access to all anonymous users. The name of the share will be “public”:\\n\n

\\r\\n#\\\/etc\\\/samba\\\/smb.conf\\r\\n[public]\\r\\n        comment = Public Shares\\r\\n        browsable = yes\\r\\n        path = \\\/data\\\/pub\\r\\n        public = yes\\r\\n        writable = no\\r\\n        write list = dawuss\\r\\n        guest ok = yes\\r\\n\\r\\n\\n\n

This sets up a share named “public” which is shown when browsing the server to any user with rights to do so. You can see it is public, but not writable except for “dawuss” (which is me) and that it is ok for guests to login.\\n\n

Next, we need to set up the guest access itself. In the global section:\\n\n

\\r\\n[global]\\r\\n        #...\\r\\n        guest account = nobody\\r\\n\\r\\n\\n\n

Which defines the account to use when authenticating guests. Don’t forget to create this user using\\n\n

\\r\\n# smbpasswd -an nobody\\r\\n\\n\n

This will create the user with no password.\\n\n

Now we have a perfectly valid Samba setup with a public share, but every time a user wants to access this share as a guest, he will have to do so by logging in as “nobody”. To complete our setup and imitate Windows behaviour, add the following line to the smb.conf global section:\\n\n

\\r\\n[global]\\r\\n        #...\\r\\n        map to guest = bad user\\r\\n\\r\\n\\n\n

This maps any unknown username to the specified guest user, so login always succeeds.\\n\n

We’re done! Remember, this will only work for unknown usernames. If an unhappy user called “pete” tries to login while there already exists a pete on the server with a different password, he will be denied access. This is normal behaviour when imitating Windows, so we’ll just have to live with that.\\n\"Watch Full Movie Online Streaming Online and Download\n"Watch movie online The Transporter Refueled (2015)

74 Responses to “Configuring anonymous public shares with Samba 3”

  1. If you wish for to take a good deal from this post
    then you have to apply these techniques to your won website.

    Have a look at my site :: travel blog sites

  2. Hi! This is kind of off topic but I need some help
    from an established blog. Is it very hard to set up
    your own blog? I’m not very techincal but I can figure things out pretty quick.
    I’m thinking about creating my own but I’m not sure where to begin. Do you have any ideas or
    suggestions? Many thanks

    My website – top credit repair companies

  3. Stunning quest there. What happened after? Take care!

    Take a look at my webpage how to install roof underlayment

  4. It’s in fact very complex in this full of activity life to listen news
    on TV, thus I just use internet for that reason, and obtain the latest news.

  5. Carina says:

    This is a great tip particularly to those fresh to
    the blogosphere. Short but very precise info… Thank you for sharing this one.
    A must read post!

  6. Hello my family member! I want to say that this post is awesome,
    great written and come with approximately
    all vital infos. I would like to see extra posts like this .

    Here is my web-site :: installing shingles on a roof

  7. I do not even understand how I finished up here, but I
    assumed this submit was once great. I don’t recognize
    who you’re however certainly you are going to a well-known blogger if you are not already.

    Feel free to surf to my web blog; live chat tv (

  8. Annabelle says:

    Today, I went to the beachfront with my children. I found
    a sea shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.”
    She placed the shell to her ear and screamed. There was a hermit crab inside and it pinched her ear.

    She never wants to go back! LoL I know this is completely off topic but I had to tell someone!

  9. Thank you, I have just been searching for info approximately this subject for a long
    time and yours is the best I’ve came upon till now.
    But, what in regards to the bottom line? Are you certain in regards to the source?

    Review my blog post party de noel estrie

  10. Piotr says:

    Apart from broken design of your page, your solution finally allowed me to start a guest samba share. I’ve spent literally hours on others blogs, sti\uck with permission denied

  11. What’s up,I log on to your new stuff named “Configuring anonymous public shares with Samba 3 | Michel’s Exhaust” regularly.Your story-telling style is awesome, keep doing what you’re doing! And you can look our website about free anonymous proxies.

  12. اغاني says:

    Hi,I log on to your blog named “Configuring anonymous public shares with Samba 3 | Michel’s Exhaust” regularly.Your writing style is witty, keep doing what you’re doing! And you can look our website about اغاني.

  13. Newsbloggers, for one, have become typing in where
    traditional news print media are neglecting.
    However, if you utilize a practical system you can escalate to new heights of success.
    They will pay you some money to examine a web site or perhaps a product for that

  14. NeedHelp says: – Hello friends from the other continent, I was determined to write this message because I need help. I have a wife and a precious son who will do 10 months of life soon I am in a situation without work. Renter wants to kick me out of my house.I shall lost everything.. whom I have no one to help me, the state does not help me. I am desperate. I do not know what to do I do not want to hurt anyone but I want to help me with some contribution at least as long as I do not go forward. I can not let my family go hungry I write with much embarrassment but I prefer to be ashamed when my family goes hungry.. Thank you so much for taking the time to reading my story. Thank you for this donate.. Even if you don’t donate, that’s fine. Every prayer – or a share – does wonders. Our family thanks you from the bottom of our hearts. ♥ Thank you for visiting my donate website.. Any help would really be appreciated,Thank you Anything would help. At the end of 60 days I will share how much money was collected.

  15. computers says:

    However, after one donation, you are able to donate again only
    after a few months whenever your body has regained the donated blood.
    The relationships you establish would be the difference between your
    success and precious time wasted. You must realise that whenever you open a brand new Forex
    position that you are, the truth is, trading currency
    pairs like a single unit.

  16. Don’t build a content rich site about athletic shoes but use a phrase like running sneakers for exercise runners.
    Education – I get the opportunity to share my experiences web-sites;
    I get to teach them what I know through articles and blog posts.
    I also update my status on Linked – In weekly, asking another question with the people I am connected with on that site.

  17. blog says:

    It doesn’t matter that you have it from – newspapers, other websites and news sources,
    whatever. Anyone can compose and talk about any topic,
    from hobbies to political vies. The informal form of your blog gives Internet consumers to be
    able to get to know the people who are behind the business enterprise better,
    that makes it easier so they can trust you together with spend money on your site.

  18. nicaragua says:

    For newest news you have to go to see the web and on the web I found this
    website as a best site for most recent updates.

  19. What i don’t realize is in fact how you’re now not really much more smartly-favored than you might be now. You are very intelligent. You already know thus considerably with regards to this subject, produced me personally believe it from a lot of numerous angles. Its like men and women aren’t interested unless it one thing to do with Lady gaga! Your own stuffs nice. All the time take care of it up!

  20. Hi Dear, are you really visiting this webb pasge daily, iif so then you will absolutely ake nice experience.

  21. JosephMed says:

    vpii rg this site

  22. ambercrou says:

    Hello, I am Amber a professional in content writing.

    I enjoy solving people’s problems and make them happy. That is what I have been doing for decades now.
    I have been writing since I was 12 years old and never knew it would turn out to be a full-time career. I have also been able to manage several projects that involves writing. And I worked in three organizations as a volunteer to assist people.My hobbie has always been to help people succeed. And I go the extra mile to make that happen.
    I enjoy writing Thesis and have helped people from countries like UK.
    I work with a company whose mission is to provide quality papers and make people happy. In fact, many people come to me for help on a daily basis because they know I always deliver. And I will continue to provide nothing but the best to build trust like I have been doing for the past few years.

    Expert writer – Amber – Vahealthchartbook Corps

  23. lianaly says:

    Hello and welcome to my website . I’m Liana.
    I have always dreamed of being a book writer but never dreamed I’d make a career of it. In college, though, I helped a fellow student who needed help. She could not stop telling me how well I had done. Word got around and someone asked me for to write their paper just a week later. This time they would pay me for my work.
    During the summer, I started doing research papers for students at the local college. It helped me have fun that summer and even funded some of my college tuition. Today, I still offer my writing skills to students.

    Professional Writer – Liana Lynn – Literaturematters Confederation

  24. janawood says:

    Hi Everybody
    Thanks for checking out my about page. My name is Jana Woods.
    I have worked since high school in this niche. My aptitude for writing started at a young age. I wrote poetry as a child and eventually went on to work with my school newspaper.
    This early tryst into news reporting eventually led me to academic writing. There is plenty of work for professional writers. I specialize in essays, but have the skills to do all types of academic writing.
    Email me for more information about rates and a price quote. I’m looking forward to helping you.

    Academic Writer – Jana – Csnbiologyclub Corps

Leave a Reply

Your email address will not be published. Required fields are marked *