Setting up Samba on a Linux installation

Submitted by Jochus on Fri, 22/02/2013 - 23:21 | Posted in: Linux

I just found this old article I've written down once to configure Samba on a Linux installation. This article was written in Dutch, but I didn't want it to get lost, so I added it to my blog.

Installatie Samba

  • Installatie pakket
  • $ sudo aptitude install samba

  • Ga naar /etc/samba/smb.conf en pas volgende wijzingen toe:
  • Toegang tot werkgroep:
  • # Change this to the workgroup/NT-domain name your Samba server will part of
       workgroup = MSHOME

  • Netwerknaam computer:
  • # server string is the equivalent of the NT Description field
       server string = %h server (Samba, Ubuntu)

  • Sharen van de home folder:
  • # Un-comment the following (and tweak the other settings below to suit)
    # to enable the default home directory shares.  This will share each
    # user's home directory as \\server\username
       comment = Home Directories
       browseable = yes
    # By default, \\server\username shares can be connected to by anyone
    # with access to the samba server.  Un-comment the following parameter
    # to make sure that only "username" can connect to \\server\username
    # This might need tweaking when using external authentication schemes
    ;   valid users = %S
    # By default, the home directories are exported read-only. Change next
    # parameter to 'yes' if you want to be able to write to them.
       writable = yes

  • Toevoegen gebruiker aan SMB PASSW DB:
  • $ sudo smbpasswd -a jochus
    New SMB password:
    Retype new SMB password:

  • Herstart Samba
  • $ sudo /etc/init.d/samba restart

Installatie SMBFS

  • Verder wil ik ook mijn windows-server data schijf kunnen mounten. Er zijn hiervoor 2 mogelijkheden. Ofwel gebruik je een commandline tooltje als ''smbclient'', ofwel ga je data schijf mounten alsof het echte harde schijven zijn
  • Installeer smbfs
  • $ sudo aptitude install smbfs

  • Om andere gebruikers de map te kunnen mounten, moeten we deze ook rechten geven
  • $ sudo chmod u+s /usr/bin/smbmnt /usr/bin/smbumount

  • Maak een mount point aan
  • $ sudo mkdir /mnt/data

  • Om aan de schijf te kunnen geraken moeten we inloggen met Windows credentials
  • $ sudo nano /etc/samba/user

  • Vul in

  • Voor de veiligheid
  • $ sudo chmod 0600 /etc/samba/user

  • Voeg aan /etc/fstab het volgende toe:
  • //server/share   /mnt/data   smbfs   credentials=/etc/samba/user,rw,uid=bob   0   0

  • Mounten gaat nu via:
  • $ mount /mnt/data

Add new comment

The content of this field is kept private and will not be shown publicly.


  • Lines and paragraphs break automatically.
  • You can caption images (data-caption="Text"), but also videos, blockquotes, and so on.
  • Web page addresses and email addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <bash>, <cpp>, <css>, <html5>, <java>, <javascript>, <php>, <sql>, <xml>. The supported tag styles are: <foo>, [foo].
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.