Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

  1. #1
    Join Date
    Sep 2007
    Beans
    60

    How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    When I first started messing around with Ubuntu, Samba was one of the first things I wanted. The guides posted here are both outdated, don't work, and overly complicated. It took me about 2 hours of custom work and messing around to do.

    Last night I installed 10.04 with a fresh install, and I went to one of the Samba threads here that I used with 9.10. Doesn't work, filepaths are incorrect, and the template given for smb.conf is wrong. I googled it, and I got this link. Much easier and cleaner, and worked the first time through.

    Ubuntu 10.04 Lucid Lynx has come out, and that means it’s time to explain how to do a basic Samba setup on the new version. All Terminal commands in this walkthrough are bolded, and USERNAME stands for your username on your Ubuntu system.

    First, you’ll need to install Samba. Fire up a Terminal window and use this command:

    sudo apt-get install samba

    Follow the default prompts to install Samba. Now, Samba uses a separate set of passwords than the standard Linux system accounts (stored in /etc/samba/smbpasswd), so you’ll need to create a Samba password for yourself with this command:

    sudo smbpasswd -a USERNAME

    (USERNAME, of course, is your actual username.)

    Type a suitably strong password (make sure it includes uppercase, lowercase, punctuation, and numbers). Once your password is created, the next step is to edit your /etc/samba/smb.conf file, the configuration file for Samba. Begin by creating a folder named ‘test’ on your home folder; we’ll use that for our test shared folder (you can create other shared folders using the same method):

    mkdir /home/USERNAME/test

    Next, make a safe backup copy of the original smb.conf file to your home folder, in case you make an error:

    sudo cp /etc/samba/smb.conf ~

    Now use your text editor of choice to edit smb.conf:

    sudo gedit /etc/samba/smb.conf

    (New users will probably find gedit the easiest to use due to its GUI; but you can use emacs or vi just as readily, especially if you’re using the server version of Ubuntu, which doesn’t include X11 by default.)

    Once smb.conf has loaded, add this to the very end of the file:

    [test]
    path = /home/USERNAME/test
    available = yes
    valid users = USERNAME
    read only = no
    browsable = yes
    public = yes
    writable = yes


    (There should be no spaces between the lines, and note also that there should be a single space both before and after each of the equal signs.)

    These settings will share the test folder we created earlier, and give your username and your username alone permission to read and write to the folder. Once you have input the changes, save smb.conf, exit the text editor, and restart Samba with this command:

    sudo restart smbd

    Once Samba has restarted, use this command to check your smb.conf for any syntax errors:

    sudo testparm

    If you pass the testparm command, Samba should be working; try accessing the shared folder from another computer on your LAN.

    -JM
    I'll note one major difference from the 51 page thread here on Samba. You DO NOT need to create a separate Samba user for the computers you want to connect to the Samba share. You can, and restrict read/write abilities, but by this tutorial, you connect using the USERNAME credentials.

    If anyone wants to append anything here, like WINS support, or adding users so that you can disable gust access, or go into detail with chmod options, feel free. This is a great beginning step to Samba, and I'd love for this topic to chronicle the more advanced things you can do with it after you got your starting point ready.
    Last edited by d00derino; May 1st, 2010 at 06:39 PM.

  2. #2
    Join Date
    Sep 2006
    Beans
    48

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    Great guide works perfectly Thank you

    Dimoutlook

  3. #3
    Join Date
    Sep 2009
    Location
    Bitburg, Germany
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Lightbulb Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    I figured it out, sorry but I believe my way is easier and I just want to spread the word. Please see here: http://ubuntuforums.org/showthread.php?t=1502265
    * Challenges are meant to be overcome;
    so adapt, attack and overcome! *
    http://www.feralbytes.com/

  4. #4
    Join Date
    Sep 2007
    Beans
    60

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    I get where you're coming from with GUI being the easiest solution, but from what I've found it seems that it doesn't work as faithfully as the terminal way.

    Trust me, I have tried it GUI-wise too.

  5. #5
    Join Date
    Sep 2010
    Location
    Cali
    Beans
    9
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    thanks alot. it works like a chamr

  6. #6
    Join Date
    Jun 2007
    Beans
    1

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    d00derino, thanks so much for posting this "how to" Samba guide; the process you outlined worked perfectly for me on the first try! Instead of connecting to /home/username/test, I have it connecting to /home/username, so I can get to all of my stuff. That said, I do still need help with two issues that I'm hoping someone can help me with.

    EDIT (resolved): I have a second hard drive, /dev/sdb, which is mounted in a removable tray, and it is named "2TB-Backup" ... I figured out how to add that as another share. Right below the [home] section provided by d00derino, I added the following section:

    [HDD2]
    # To mount the drive, /dev/sdb, named "HDD2"
    path = /media/HDD2
    volume = 2nd HDD
    available = yes
    valid users = yourusername
    read only = no
    browsable = yes
    public = yes
    writable = yes

    Also, under the section named ####### Authentication #######, I also uncommented the line, security = user to require my linux user account log-on for access.


    Something I can use help with is that my Mac OS X displays two, back-to-back, pop-up windows for 0.5 seconds each ... something about asking me if I want to allow the Finder.app to allow incoming connections. On my Mac OS X firewall, I did set it to allow incoming connections for smbd because on occasion, I connect to it via samba from other systems. I also enabled nmbd to allow incoming connections, but it didn't help. Not sure if I need it to accept incoming connections...?

    Thanks so much! I scoured a dozen posts before finding this one ... glad I didn't go with simple file sharing. Thanks again! - Rich
    Last edited by riffin-rich; November 6th, 2010 at 09:59 PM. Reason: answered my own question

  7. #7
    Join Date
    Sep 2009
    Location
    Vernon, Florida
    Beans
    12
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    OK guys, I'm an idiot, so can you please help me out here???

    Everything was working AOK until I got to the password part. I entered my password and then entered it a second time (for confirmation) and it gave me an error (I wish I hadn't closed the terminal window now!!! See what I mean? I'm a dumba_ _ !!!) that it didn't add it for USERNAME. I then tried it again entering my password with using my USERNAME (password separated by a space and then username). After that didn't take, I entered the command (sudo smbpasswd -a USERNAME) again and entered my password without a space and then my username that didn't work either, so where do I go from here?

    I forgot to mention that I'm running 11.04. Does that make a difference? Additionally, I've got "File Sharing", "Personal File Sharing", and "Giver" packages installed on my system. I still can't share files with my Dad's computer. We are linked through a Netgear router.

    I'd sure appreciate your help on this one.

    Thank you,

    Dennis S. Primm
    Last edited by Dennis Primm; August 22nd, 2011 at 07:38 PM. Reason: Valuable information left out.

  8. #8
    Join Date
    Sep 2009
    Location
    Vernon, Florida
    Beans
    12
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    I forgot to mention that I'm running 11.04. Does that make a difference?
    Last edited by Dennis Primm; August 22nd, 2011 at 07:39 PM. Reason: I want to delete this post.

  9. #9
    Join Date
    Aug 2006
    Beans
    13,354
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    It's real simple.
    1. Copy/paste the following command into a terminal (with your username), and hit enter:
    Code:
    sudo smbpasswd -a USERNAME
    2. Type the password, and hit enter.

    3. Retype the password and hit enter.

    PS: Don't add or remove spaces or other characters anywhere.

  10. #10
    Join Date
    Sep 2009
    Location
    Vernon, Florida
    Beans
    12
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: How To: Definitive Samba Guide for 10.04 (probably 9.10 too)

    I just opened the terminal again and entered the command you gave me and then I typed in my password and it returned "Sorry, try again." I then tried again and it responded with the same thing. Should I go back and start from the beginning?

    Thank you so much for your assistance!

    Sincerely,

    Dennis

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •