How To - Simple File Sharing in Mint

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
TomatoBoy

Re: How To - Simple File Sharing in Mint

Post by TomatoBoy »

I wonder please if someone might be able to shed some light on a problem that has me stumped despite a great deal of forum searching. My apologies if this has been dealt with, I am very new to Linux and may well miss sometrhing through newbie confusion.

We have a network with a Netgear router handling all dhcp for two Windows 7 computers, and up until now a laptop running Mint 10. With Altair's excellent guide and other resources around the net we managed to set-up file sharing through Nautilus with guest access allowed. A second Mint PC has joined the fold and also the sharing via Nautilus.

We decided to add Samba users/password access for security on both Mint units via the smbpasswd method in Altair's text.

We decided to remove the accounts after having multiple error messages (which I have not recorded, sorry) and some issues accessing the shares from the Mint machines. Both Mint machines had the Samba users/password removed using the -x switch.

Everything is fine again Mint > W7 and W7 > Mint except on the new Mint PC whose shares can be accessed by all the other computers and it can access the other Mint computer but when it is asked to access the W7 computer shares it now produces a login box and despite being provided with the correct password the following error is produced:

Unable to mount location dbus error org.freedesktop.dbus.error.noreply: message did not receive a reply (timeout by message bus)

Two things, I now notice that after accessing shares on other computers the folders concerned are mounted on the desktop of the (working) Mint PC until it is switched off. I don't remember that happening before though it probably was. Any confirmation of the correct behaviour of this would be gratefully received.

Also, just to point out that it was possible to access the W7 shares on the Mint PC that is now playing up before we did the Samba users/password thing :(

Can anyone please help me? I am beyond my learning curve at the moment. Many thanks.
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

Unable to mount location dbus error org.freedesktop.dbus.error.noreply: message did not receive a reply (timeout by message bus)
There is an old bug concerning saved passwords to remote shares. Did you have it remember the username and password "forever"? If so this might be a known bug: https://bugs.launchpad.net/ubuntu/+sour ... bug/463267

There is a workaround mentioned in that bug report that basically deletes the saved username and password so you'll have to authenticate manually. To find the saved username and password:

Menu > Accessories > Passwords and Encryption Keys > Passwords Tab

Expand the "Passwords: login" entry and you should see the the entry for the remote share.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
TomatoBoy

Re: How To - Simple File Sharing in Mint

Post by TomatoBoy »

Hi Altair, thank you so much for the prompt response :)

I checked in the passwords tab and the only one there was for the wireless network, which incidentally had all sorts of driver issues involving the blacklisting of several before it would work at all, and it still will not allow sharing at all, it only works over ethernet.

Then, I tried logging onto the W7 share for the duration of the session, you rightly suggested I was trying the 'forever' option. The share became accessible straight away, which is great.

Could I please ask a couple of questions, does the bug occur only after a Samba name/password is set or was it going to happen in any case? Could it be related to any of: the wifi driver issue, the fact this is 64 bit and the laptop is 32 bit (and works perfectly 'forever') or anything else I cold have caused? I ask in case a reinstall might resolve the issue? The problem is this is going to be a very basic fileserver and backup location waking on lan (said hopefully)so I have to be sure everything is talking without us interceding each session.

I'm so desperate to use Mint for this, I hope there is a solution.

Thanks again Altair.
karliet

Re: How To - Simple File Sharing in Mint

Post by karliet »

There are actually other ways of file sharing through a network such as
dropbox and teamviewer those 2 dont require any setup past making a account and installing on both computers dropbox has a (i think) 2gb limit on the files you can send through it while teamviewer has unlimited because your sending the file directly to the other computer instead of leaving it on a 3rd party server
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

There's also DuktoR4, TransferOnLan, SSH, NFS, and Classic Samba sharing but this is a HowTo on Usershares. That's why it's in the "Tutorials/Howtos" section :wink:
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
BostonPeng

Re: How To - Simple File Sharing in Mint

Post by BostonPeng »

altair4 wrote:For those of you that have installed Mint Debian you have probably noticed that Nautilus-share does not work. There are a few more steps required:

Linux Mint Debian Edition Preliminary Steps

Step 1: "Guest Access" option is disabled by default. To enable it:

Open smb.conf as root:

Code: Select all

gksu gedit /etc/samba/smb.conf
Add the following lines to the [global] section:

Code: Select all

usershare allow guests = yes

Code: Select all

map to guest = Bad user
And restart samba:

Code: Select all

sudo service samba restart
Step 2: You do not have permissions to create a usershare because you are not included in the correct group.

Code: Select all

sudo gpasswd -a your_user_name sambashare
Step 3: Add samba client packages

Code: Select all

sudo apt-get install gvfs-fuse
sudo apt-get install libsmbclient
sudo apt-get install smbclient
sudo apt-get install python-smbc
Then add yourself to the fuse group:

Code: Select all

sudo gpasswd -a your-user-name fuse
Step 4: Logoff and Login again for all the group changes to take affect

There is one more thing I need to tell you. After you select the "Create Share" button nautilus abruptly closes and for a very brief moment your entire desktop will disappear. Fear not - it will return. I have no earthy idea what's going on there but there's probably a Debian bug report somewhere that I will try and find to see if there is a workaround or fix.
Thanks for posting this, altair! I'd been needing to find the fix for this annoying problem.
xcat
Level 1
Level 1
Posts: 1
Joined: Sat Jan 14, 2012 6:15 am

Re: How To - Simple File Sharing in Mint

Post by xcat »

For those of you that have installed Mint Debian you have probably noticed that Nautilus-share does not work. There are a few more steps required...

Your instructions solved my sharing problems too. Thanks, Altair4
pulf

Re: How To - Simple File Sharing in Mint

Post by pulf »

I have done this with good result some times, but now with cinnamon installed it doesn't look the same. When I right click on a folder there isn't the "sharing" to click on. Do I have to go in and write something in smb.conf? Seems a little geekish nowadays.
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

It sounds like you don't have the nautilus-share package installed:

Code: Select all

sudo apt-get install nautilus-share
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
pulf

Re: How To - Simple File Sharing in Mint

Post by pulf »

altair4 wrote:It sounds like you don't have the nautilus-share package installed:

Code: Select all

sudo apt-get install nautilus-share
There it was! :D Very simple, but strange it wasn't installed from the beginning.
Thanks!
toomuchcoffee

Re: How To - Simple File Sharing in Mint

Post by toomuchcoffee »

Thanks a lot for this :D .
jazzcat

Re: How To - Simple File Sharing in Mint

Post by jazzcat »

I've just installed kde on my lmde partition, and streaming etc from samba works fine when I am in the cinnamon de but not when I am in kde. Any thoughts?
jazzcat

Re: How To - Simple File Sharing in Mint

Post by jazzcat »

Here is the error I am getting from vlc

Your input can't be opened:
VLC is unable to open the MRL 'smb://christopher@stora/MyLibrary/MyVideos/myvideo.avi'. Check the log for details.
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

I don't use KDE and have no experience with VLC.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
jazzcat

Re: How To - Simple File Sharing in Mint

Post by jazzcat »

the issue appears to be present on dragonplayer as well
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

Please start a separate topic. Your questions are unrelated to this HowTo.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
PcMojo

Re: How To - Simple File Sharing in Mint

Post by PcMojo »

@altair4 First of all, thanks a million for this and your many other threads on networking, sharing, Samba etc. They are extremely useful giving step by step instructions, with enough explanation given so we can research something further, without so many details that our eyes glaze over in a fog of confusion! I've had to write technology training materials before and most people don't realize how difficult it is to achieve that balance.

After trying this and the information you've posted in other threads, I still have sharing issues. (probably from childhood :wink: ) I could sometimes see Vista from Mint, but not Mint from Vista (I set up filesharing on Vista) Since it wasn't working, I was going to undo the changes that I made. Upon researching the smbpasswd command I found -d disables and -x deletes the samba account, but neither worked. I figured out why from this article: http://ubuntumanual.org/posts/73/how-to ... -in-ubuntu It states, “By Default network users are disabled after adding them, make sure you run the enable network user command above. (smbpasswd -e)” So I couldn't delete or disable the accounts because they were never enabled. Perhaps that was my problem all along and the share wasn't working because the Samba accounts were never enabled. If this is accurate, I thought you might want to add it into your instructions.

Sorry for such a long post but I actually do have a question for you. Since moving to Linux, I've gotten accustomed to naming things in lower case. When adding any new network object to Windows, by default they are named in upper case. If my Linux hostname is mypc and Windows adds it as MYPC, what to I write in the “netbios =” line in the smb.conf file? Or will I have to rename my Linux host? Am I correct in assuming that case matters when naming the hostname ?

Thanks again, for all of your helpful posts!
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

Upon researching the smbpasswd command I found -d disables and -x deletes the samba account, but neither worked. I figured out why from this article: http://ubuntumanual.org/posts/73/how-to ... -in-ubuntu It states, “By Default network users are disabled after adding them, make sure you run the enable network user command above. (smbpasswd -e)”
From man smbpasswd:
-e
This option specifies that the username following should be enabled in the local
smbpasswd file, if the account was previously disabled. If the account was not
disabled this option has no effect.
The "-a" option adds and enables the unix user. The "-e" option is only required if the already added samba user account had been disabled ( -d ).
If my Linux hostname is mypc and Windows adds it as MYPC, what to I write in the “netbios =” line in the smb.conf file?
Shouldn't matter. Linux is case sensitive but SMB / Samba is not.

EDIT: If your host name is in fact "mypc" you don't need to add "netbios name" in smb.conf. Debian / Ubuntu / Mint automatically makes the netbios name match the host name. It's built into the default. You only need to explicitly add the netbios name in smb.conf if your hostname exceeds the 15 character length rule.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
PcMojo

Re: How To - Simple File Sharing in Mint

Post by PcMojo »

I understand what you are saying about what the man pages say about it being enabled by default, but I'm seeing something different on my end. Before, when using any smbpasswd command I would get errors (as if there was no account). After enabling the accounts, the commands will work and I won't get errors. Also, I couldn't see my linux share from Vista. Now I can see it and it even asks me for a network password. The only change I have made was enabling the accounts. Perhaps the man pages are dated, or I have a different version than you, but I am definitely seeing some results by enabling the account. I still can't connect though, Vista is prompting for the connection ID and password and it won't accept either of the Samba IDs and passwords. I made the Vista a dual boot, so I may boot up in Ubuntu and see if it is (yet another) Vista issue. I used to be pretty good with networking XP clients, but Vista is just horrible!


***update*** I have made a connection to Vista, but that's from the Vista side, I turned on "client folder and print sharing" in Vista and now I can see the Vista share. It kept asking me for my name and password on the mint machine when I would click on the Vista folder. It had three options for remembering the password, one was immediately, the next was until logout, and the last was forever. I must have done it 20 times choosing "logout" and it would just reappear. When I chose "forever" I could then see the folder share. I just wanted to add this in case anyone else was having the same issue. I still can't see mint from Vista though. I've restarted the samba services & rechecked all your instructions on the smb.conf file and can't find anything wrong.
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Post by altair4 »

** The "-a" option adds and enables the unix user to the samba password database. It's always done that ( well, at lest since 1999 ). You do have to have the Unix user to begin with however. If I try to add a user named blzebub to the samba password database I well get this error:
sudo smbpasswd -a blzebub
[sudo] password for altair:
New SMB password:
Retype new SMB password:
Failed to add entry for user blzebub.
Why? Because there is no local user named blzebub on my Linux system.

** Selecting remember forever vs any of the other options has no affect on actually accessing the share at that moment.

** If you can't see the Mint machine from another machine on your LAN you might want to go through the checklist:
Samba Browsing Problems Checklist: http://forums.linuxmint.com/viewtopic.p ... 46&start=0
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Post Reply

Return to “Tutorials”