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

Thread: HOWTO: No nonsense networking on Thunar

  1. #1
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    HOWTO: No nonsense networking on Thunar

    when I first tried out XFCE back in the 7.10/8.04 days, I liked it but the lack of native network browsing was a deal breaker for me. Almost four years later, I've come back to XFCE and found that networking does work finally!

    By networking, I mean Thunar now supports dynamic Samba share browsing. Of course you could always install samba, nfs, sftp or any other file sharing utility, manually mount your shares and then browse to them, but that's not always very efficient and can be a huge road block for newbies, as it requires knowledge of how networking functions, while networking just plain works on Windows and OSX.

    As of Xubuntu 11.10, getting samba configured is fairly simple, and doesn't even require Gigolo (I don't know why they included that particular piece of software in this release of Xubuntu instead of just including a functioning samba install)

    1. Install the necessary packages:

    Code:
    sudo apt-get install samba smbfs smbclient fusesmb gvfs-backends
    2. Configure your /etc/samba/smb.conf

    There are an infinite number of ways to set up your smb.conf and for the uninitiated, it can be a daunting task. But don't worry, I will break it down as simply as I can.

    First off, it seems that Thunar is pretty picky about a couple of settings. In order to browse networked shares, you must make sure this line is in the [global] section of your smb.conf

    Code:
    name resolve order = bcast host lmhosts wins
    A similar line already exists in the default smb.conf which is commented out with a ';'. You can choose to uncomment and edit that line or simply add a new one.

    Then the next major order of business is to set up one or more shares. Set them up like this and you can't go wrong:
    Code:
    [home-ryan]  ## This is what the share will be called when you browse to it.
    comment = Ryan's Home  ## This line is optional
    path = /home/ryan  ##  This line dictates where the share is on your computer.  
    browseable = yes  ## Self explanatory...
    guest ok = yes  ## Once again, self explanatory...
    create mask = 0755  ## allows read/write access to new files created within the directory
    directory mask = 0755 ## allows read and write of existing files
    Beyond that, you just need to make sure that all of your computers exist in the same workgroup. Although it's not 100% necessary, it's the standard practice for a reason. To do so, add or edit a line in the [global] section of your smb.conf

    Code:
     workgroup = MSHOME
    Where MSHOME is the default for Windows networks. Change it to whatever you decide to call your workgroup.

    so in conclusion, here is a very simple yet functional, complete smb.conf that will get file sharing up and running. Just tweak it to suit your particular machine.

    Code:
    [global]
    workgroup = MSHOME
    server string = %h server (Samba, Mythbuntu)
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 0
    panic action = /usr/share/samba/panic-action %d
    dns proxy = no
    security = share
    name resolve order = bcast host lmhosts wins
    
    [home-user]
    comment = User Home
    path = /home/user
    public = yes
    writable = yes
    create mask = 0755
    directory mask = 0755

  2. #2
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO: No nonsense networking on Thunar

    if this helps anyone I'd really appreciate feedback. This setup worked on all of my computers but I'd like to hear how well it faired for other people.

  3. #3
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,639
    Distro
    Ubuntu

    Re: HOWTO: No nonsense networking on Thunar

    Thread moved to Tutorials & Tips.

  4. #4
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: No nonsense networking on Thunar

    Is it necessary to configure a functioning samba server to enable samba browsing in Thunar?

  5. #5
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO: No nonsense networking on Thunar

    Is it necessary to configure a functioning samba server to enable samba browsing in Thunar?
    Perhaps not, but why wouldn't you want bi-directional file sharing? I have never once even considered setting up Samba without setting up each machine as sever & client. On my home network I like to be able to access any file from any computer. I realize that this may pose a potential security risk, which is why I set up samba to only share files in $HOME. If I need to edit a system file on my server for example, that's what ssh is for. But SMB makes for easy dynamic file sharing at the user level.
    I suppose you could just omit adding any shares to the smb.conf and just configure the global section as per my instructions.

  6. #6
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: No nonsense networking on Thunar

    Quote Originally Posted by N00b-un-2 View Post
    Perhaps not, but why wouldn't you want bi-directional file sharing? I have never once even considered setting up Samba without setting up each machine as sever & client. On my home network I like to be able to access any file from any computer. I realize that this may pose a potential security risk, which is why I set up samba to only share files in $HOME. If I need to edit a system file on my server for example, that's what ssh is for. But SMB makes for easy dynamic file sharing at the user level.
    I suppose you could just omit adding any shares to the smb.conf and just configure the global section as per my instructions.
    There are a number of good reasons for not configuring every machine on your network as a server. First and foremost, it cuts down on unnecessary LAN traffic since samba is very noisy. Lots of smb traffic reduces file server performance and increases transfer speeds. It's also easier to administrate the security of one server rather than 3 or 4. You won't get caught with your samba open when you take your laptop to a wifi hotspot.

    With only a few machines, there's usually no problem but it is something to consider.

    BTW, I've been looking forward to native samba client support in Thunnar for a long time as well, I'll have to take a look now.

  7. #7
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO: No nonsense networking on Thunar

    three of the four computers on my network are hard wired, the other being my netbook. I don't trust wifi hotspots as far as I can throw them so typical practice is to tether to my Android phone when I need internet away from home. My phone is capable of connecting to 3G and wifi at the same time and tether to my computer via USB without exposing any of my computer's files.
    !!IF!! someone were to hack me over wifi, they'd get my phone instead of my computer, which aside from my vcards would be essentially useless if the hacker were even smart enough to figure out that they were talking to a phone and not a computer. Not saying it's impossible, just extremely unlikely.

  8. #8
    Join Date
    Mar 2006
    Location
    Kitakyushu Japan
    Beans
    9,361
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: HOWTO: No nonsense networking on Thunar

    Again, hacking is not the only issue with enabling multiple samba servers. But I'm not really talking about your network anyway. I'm responding to this:

    Quote Originally Posted by N00b-un-2 View Post
    if this helps anyone I'd really appreciate feedback. This setup worked on all of my computers but I'd like to hear how well it faired for other people.
    You asked for feedback. Essentially, my feed back is this: If you're giving configuration advice to others, it's important to consider how things work on networks other than your own. That's why I asked if it was necessary to configure a full samba server in order to browse samba shares with Thunar.

    Sorry for not making myself more clear previously.

  9. #9
    Join Date
    Dec 2009
    Beans
    5,847

    Re: HOWTO: No nonsense networking on Thunar

    You're missing a step.

    The remote guest does not have permissions to write to the share despite specifying so in smb.conf. Samba cannot override Linux file permissions and unless you do something it's sitting there at 755. The remote user can access but read only. I suppose you could leave it at 755 and then control what subdirectories allow write access by changing them to 777 but if you actually want to create a share that everyone can access with write abilities then you might want to add a line to your share definition:

    [home-user]
    comment = User Home
    path = /home/user
    public = yes
    writable = yes
    force user = user
    #create mask = 0755
    #directory mask = 0755
    You will need to do something like that anyway.

    If bob creates a share as defined the way you had it and betty was able to add a file it will save with owner = nobody. bob isn't nobody so he will have read access only to the file on his own machine. "force user = bob" will make the file added by betty save with bob as owner.

    To be honest creating a share - a guest share to boot - of ones own home directory gives me the willies.

    BTW:

    *The smbfs package is a dummy package. It points to the new package: cifs-utils.
    * Gigolo is a samba client package not a samba server package and it has a remarkable ability to auto mount samba shares if you use it a certain way.
    Last edited by Morbius1; December 8th, 2011 at 08:01 PM.

  10. #10
    Join Date
    Aug 2008
    Location
    Arizona State
    Beans
    419
    Distro
    Ubuntu

    Re: HOWTO: No nonsense networking on Thunar

    I was using $HOME as an example. typically, I'll actually point my shares to Videos, Music, Pictures, etc. I was just using HOME as an example. On a small home network, I don't see the harm

Page 1 of 2 12 LastLast

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
  •