Subscribe to How-To Geek

Recommended: Click Here to Run a Free Scan for Common PC Errors   [Sponsored Link]

Share Ubuntu Home Directories using Samba

Samba Server allows you to share the home directories of users automatically. This can be useful so that you don't have to manually create every share for every user.

First, make sure that you've installed Samba server.

To share the home directories, open up smb.conf with the following command:

sudo gedit /etc/samba/smb.conf

Find this section of the file, and make it match the following:

#======================= Share Definitions =======================

# 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
[homes]
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
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

Now you should be able to map a drive on windows using the following share format:

\\ubuntumachine\username

For example, if the Ubuntu machine is named ubuntuserv, and the username is geek, your share path would be \\ubuntuserv\geek

The Geek is the founder of How-To Geek and a geek enthusiast. When he's not coming up with great how-to articles, he's probably writing at his personal blog. This article was written on 01/7/07 and tagged with: Ubuntu

Comments (9)

  1. Michael Gunter

    thanks, a roommate got a nasty bug on his Win-XP box. I created a user account for him on my linux box so he could do a backup of several GB of files/fresh XP install.

    (my daughter would not lend us her iPod to use as a HDD backup. Kids these days!!)

    ;-)

  2. o5k4r.m4dr1d

    Thanx, this guide was useful for me, it works perfectly..!!

  3. kacole2

    i needed to transfer music and movies from my home pc to my carpc and this worked like a charm. thanks!

  4. aadvark

    nice guide how-to-geek! does exactly what is says on the tin.

  5. Beorn

    Great post. Well put together. The only thing I might append, is how to share another directory like /var/www in the smb.conf.

  6. Daniel

    Thx alot, been fidling with these for awhile know.
    Thx again.

  7. K

    Is there a way to give an admin access to multiple [homes] shares AND to ensure any files that the admin creates in the [homes] shares have their permissions set to the user who owns that home directory?

  8. Kaithy Aravind Reddy

    Thanks a lot. It works well, simple and effective,I did it on Ubuntu 8.04.
    my steps that worked for me.

    1) create unix user (e.g. wsuser)
    2) sudo apt-get install samba smbfs
    3) sudo smbpasswd -a wsuser
    4) sudo gedit /etc/samba/smbusers
    #add this line
    wsuser = "wsuser"
    5) sudo gedit /etc/samba/smb.conf
    # add two lines after "####### Authentication #######"
    security = user
    username map = /etc/samba/smbusers

    # Uncomment below three lines
    [homes]
    comment = Home Directories
    browseable = yes
    # add line
    writable = yes

    ————————————————–
    Thats it you can access this maching from windows using
    //linuxserver-IP/wsuser

  9. Lee Underwood

    Thanks! I was trying to figure that one out. Keep up the excellent work!


Leave a Comment




Leave your friendly comment here. If you have a computer help question, leave it on the forums instead.

Note: Your comment may not show up immediately on the site.

Copyright © 2006-2008 HowToGeek.com. All Rights Reserved.