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

Thread: Peer to peer file sharing - Samba

  1. #1
    Join Date
    Sep 2010
    Location
    Riverside, CA
    Beans
    55
    Distro
    Ubuntu 14.04 Trusty Tahr

    Question Peer to peer file sharing - Samba

    I've been trying to get Samba running for peer to peer file sharing among 4 computers, all but one running Ubuntu 11.10 and the other Scientific Linux 6.

    I've downloaded & installed (apt-get) and tweaked using suggestions from forums and web articles to the point where I am now just attempting to get 2 Ubuntu machines to share folders and files: they don't. I have two folders on each machine that I want to share /home/public and /home/imager/var/jars. They folders have permissions for all to read, write, and execute, the all belong, as do the users, to the Workgroup workgroup and both machines use the same /etc/smb.conf file.

    The machines are all physically attached to the same router and use DHCP.

    Here's the output from testparm -s:
    Code:
    [global]
    	server string = %h server (Samba, Ubuntu)
    	map to guest = Bad User
    	obey pam restrictions = Yes
    	pam password change = Yes
    	passwd program = /usr/bin/passwd %u
    	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    	unix password sync = Yes
    	syslog = 0
    	log file = /var/log/samba/log.%m
    	max log size = 1000
    	dns proxy = No
    	usershare allow guests = Yes
    	panic action = /usr/share/samba/panic-action %d
    
    [public]
    	path = /home/public
    	read only = No
    	guest ok = Yes
    
    [jars]
    	path = /home/imager/var/jars
    	read only = No
    	guest ok = Yes
    I'm new to LINUX

  2. #2
    Join Date
    Dec 2009
    Beans
    6,767

    Re: Peer to peer file sharing - Samba

    I am now just attempting to get 2 Ubuntu machines to share folders and files: they don't
    I don't know what "they don't" means.

    One machine can't see the Ubuntu machine?
    Then post the output of this command from your ubuntu machine:
    Code:
    smbtree
    One machine can see the ubuntu machine but can't access the shares?
    Then post the output of these commands:
    Code:
    ls -dl /home/public
    Code:
    ls -al /home/imager/var

  3. #3
    Join Date
    Sep 2010
    Location
    Riverside, CA
    Beans
    55
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Peer to peer file sharing - Samba

    Thanks, I'm a bit frustrated ...

    Here's the output of smbtree from machine "blue":
    Code:
    WORKGROUP
    	\\BLUE           		blue server (Samba, Ubuntu)
    		\\BLUE\applications   	
    		\\BLUE\IPC$           	IPC Service (blue server (Samba, Ubuntu))
    		\\BLUE\jars           	
    		\\BLUE\public
    Here is the output of ls -dl /home/public
    Code:
    drwxrwxrwx 2 programmer workgroup 4096 2012-12-13 09:34 /home/public
    and here is the last, the output of ls -al /home/imager/var
    Code:
    drwxrwxrwx  3 imager root      4096 2012-11-26 10:23 .
    drwxr-xr-x 19 imager imager    4096 2012-12-12 15:21 ..
    drwxrwxrwx  2 imager workgroup 4096 2012-12-14 08:45 jars
    Blue can't see the other machine I'm working with at this time.
    The other machine didn't start smbd when I rebooted but with smbd running it doesn't see any machines including itself.

  4. #4
    Join Date
    Dec 2009
    Beans
    6,767

    Re: Peer to peer file sharing - Samba

    If the other machine didn't start smbd it may not have stared the name server either:
    Code:
    sudo service nmbd restart
    After that smbtree from blue may list it.

    If you have done anything on the other machine's firewall you might want to disable it just to see if it's getting in the way.

  5. #5
    Join Date
    May 2006
    Location
    Milwaukee,WI
    Beans
    6,280
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: Peer to peer file sharing - Samba

    i don't see workgroup defined in your smb.conf file.

  6. #6
    Join Date
    Dec 2009
    Beans
    6,767

    Re: Peer to peer file sharing - Samba

    Remember this is the output of testparm. If you specify workgroup = WORKGROUP it won't show up in testparm since that is the default samba value. The default samba settings aren’t in smb.conf only overrides or additions.

    Besides, it doesn't matter what the workgroup is unless he has these machines in different subnets. Smbtree should show every workgroup and within every workgroup every host - just like Nautilus would.

  7. #7
    Join Date
    Sep 2010
    Location
    Riverside, CA
    Beans
    55
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Peer to peer file sharing - Samba

    smbd and nmbd were running on both machines.

    Now the other machine "hpnotebook" sees this one "blue" and I can create files in the two folders. Good!

    But this is what I get when I rerun smbtree on blue:

    Code:
    WORKGROUP
    	\\HPNOTEBOOK     		hpnotebook server (Samba, Ubuntu)
    cli_start_connection: failed to connect to HPNOTEBOOK<20> (0.0.0.0). Error NT_STATUS_HOST_UNREACHABLE
    	\\BLUE           		blue server (Samba, Ubuntu)
    		\\BLUE\applications   	
    		\\BLUE\IPC$           	IPC Service (blue server (Samba, Ubuntu))
    		\\BLUE\jars           	
    		\\BLUE\public

  8. #8
    Join Date
    Dec 2009
    Beans
    6,767

    Re: Peer to peer file sharing - Samba

    On both blue and the other machine you are going to have to edit smb.conf directly as root:
    Code:
    gksu gedit /etc/samba/smb.conf
    Add the following line - ironically right under the workgroup line:
    Code:
    name resolve order = bcast host lmhosts wins
    Save smb.conf and restart samba on both machines:
    Code:
    sudo service smbd restart
    Then pray

    Note: after starting smbd on both machines it may take a few minutes for things to settle down so ...

  9. #9
    Join Date
    Sep 2010
    Location
    Riverside, CA
    Beans
    55
    Distro
    Ubuntu 14.04 Trusty Tahr

    Smile Re: Peer to peer file sharing - Samba

    Quote Originally Posted by Morbius1 View Post
    On both blue and the other machine you are going to have to edit smb.conf directly as root:
    Code:
    gksu gedit /etc/samba/smb.conf
    Add the following line - ironically right under the workgroup line:
    Code:
    name resolve order = bcast host lmhosts wins
    Save smb.conf and restart samba on both machines:
    Code:
    sudo service smbd restart
    Then pray

    Note: after starting smbd on both machines it may take a few minutes for things to settle down so ...
    It appears to have worked - mostly. All three machines have identical smb.conf files and after rebooting all machines "hpnotebook" and "orange" see all three machines. "blue" sees itself and "orange" but before I rebooted it saw "hpnotebook". For sure it's slow. Hmm.

    Next to see if I can cajole "maroon" which runs Scientific Linux (derived from Red Hat) to join.

    Thanks

  10. #10
    Join Date
    Dec 2009
    Beans
    6,767

    Re: Peer to peer file sharing - Samba

    "blue" sees itself and "orange" but before I rebooted it saw "hpnotebook". For sure it's slow. Hmm.
    hpnotebook seems to be a reoccurring problem for some reason. If this persists there are other ways to do this:

    ** Use your router to assign static ip addresses to all the clients so you don't have to browse to them any more. You can issue a:
    Code:
    nautilus smb://192.168.0.100
    Then bookmark the darn thing.

    ** If static ip addresses are not possible then you can use zeroconf ( avahi ) to find these hosts. Avahi can find samba hosts very quickly but everyone has to be running avahi and you need to set up an avahi service config file ( 9 line config file - identical on every host ) on every host for this to work.

    Edit: Actually, all of your Ubuntu machines should have the avahi-daemon already running so although you cannot use avahi to "browse" to find the samba share you should be able to connect to the machines by an mDNS qualified host name. Try this:
    Code:
     nautilus smb://hpnotebook.local
    And please don't ask me about anything related to RedHat. It's been years but they used to do strange things with samba over there and I'd just as soon not start drinking heavily again.
    Last edited by Morbius1; December 15th, 2012 at 10:37 PM.

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
  •