How To - Simple File Sharing in Mint

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Re: Simple File Sharing in Mint

Postby altair4 on Sun Oct 18, 2009 1:20 pm

SallyK, looking at the permissions on your share:
drwxrwxrwx 16 maria users 4096 2009-10-18 15:56 /home/maria/data

there was no reason for the Nautilus dialog box to open and ask you to add permissions. Everybody was already set to read/write/execute.

Edit: I think that answer requires further clarification because ownership, permissions, and samba permissions are a difficult concept that messes me up all the time.

The share has permissions drwxrwxrwx, meaning that from a samba perspective anyone can copy from or copy to that share. The problem you faced is that the guest is sending the file over with the following ownership: owner = nobody and group = nogroup. The only way for owner=maria to edit owner=nobody is for maria to be part of the same group as nobody. The easiest way around this issue is to use the force user = parameter to make linux think that nobody is maria.

You know, no matter how hard I try I can't seem to be as clear and eloquent as Fred :lol: I'm sure he has a posting somewhere that explains this far better than I just did. :wink:
Last edited by altair4 on Sun Oct 18, 2009 1:43 pm, edited 1 time in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Linux Mint is funded by ads and donations.
 

Re: Simple File Sharing in Mint

Postby SallyK on Sun Oct 18, 2009 1:36 pm

Thanks altair4, that makes sense - before I worked out how to automount it, I gave it every permission in sight so as to make it available from both distros.

Thanks again for all your help.
User avatar
SallyK
Level 3
Level 3
 
Posts: 177
Joined: Fri Oct 02, 2009 5:22 pm

Re: Simple File Sharing in Mint

Postby Carpintonto on Sun Oct 18, 2009 2:18 pm

altair4 wrote:You know, no matter how hard I try I can't seem to be as clear and eloquent as Fred :lol: I'm sure he has a posting somewhere that explains this far better than I just did. :wink:


Fred really can break it down, but this worked for me and I have been chasing all through a bunch of Ubuntu forums to end up back where I belong!

good job, thanks again
Carpintonto
Level 1
Level 1
 
Posts: 21
Joined: Tue Jun 30, 2009 7:44 pm
Location: Kellogg Idaho

Re: Simple File Sharing in Mint

Postby eric49a on Sat Apr 03, 2010 2:08 am

ok i got samba to share my files with one of my xp comps but not the other one. the one that it is sharing with is connected to the Internet. but the other xp comp is connected to my mint comp via a switch and its not connected to the Internet. So i dono how to get samba to work with the switch I've got. if any one could help that would be nice
eric49a
Level 1
Level 1
 
Posts: 3
Joined: Sat Apr 03, 2010 1:52 am

Re: Simple File Sharing in Mint

Postby altair4 on Sat Apr 03, 2010 9:04 am

eric49a,

You might want to post a separate topic since this seems less a samba issue and more a network issue. Especially since I don't know what you mean by the term "switch". The two machines that can connect to shares appear to go through the same router but the machine that doesn't is connected to a "switch" - the other end of which is connected to what exactly.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby altair4 on Fri Sep 10, 2010 2:31 pm

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 - right under the workgroup line:
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.
Last edited by altair4 on Sun Aug 25, 2013 2:52 pm, edited 7 times in total.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby AbeFreeman on Tue Sep 28, 2010 9:22 am

I've got / and /swap set up as ext4, and then 2 NTFS partitions that I keep my data on. I shared the folders, with guest access, as per your instructions, but the other user (kids) on this machine can't even see the ntfs partitions in the file browser. I thought it might me related to the problem Ivleph was having with a virtualbox trying to access the partitions, but when I tried to edit /etc/fstab, the ntfs partitions weren't even listed. Just / and /swap. I've already mounted them. What else do I need to do to make them available?


[2nd question] I also want the kids account to by default access all the same data files that the main user does for certain programs (like Anki, since they already made a bunch of flashcard decks using the main user's account). I don't mind if I make all data available, just so long as they don't have the power to delete stuff. How do I do this?
User avatar
AbeFreeman
Level 3
Level 3
 
Posts: 146
Joined: Wed Aug 04, 2010 12:36 am

Re: How To - Simple File Sharing in Mint

Postby altair4 on Tue Sep 28, 2010 12:05 pm

but when I tried to edit /etc/fstab, the ntfs partitions weren't even listed. Just / and /swap. I've already mounted them. What else do I need to do to make them available?

You mounted them through Nautilus I assume. If so then they will mount with owner = You and with permissions set at 700 meaning "You" will have read write access and no one else. One way to fix this is to have them automount in fstab. Another way is to do the following:
Edit smb.conf as root:
Code: Select all
gksu gedit /etc/samba/smb.conf

Add the following line to the [global] section of smb.conf:
Code: Select all
force user = you

Change "you" to your own login user name
Save the file, exit gedit, and back in the terminal restart samba:
Code: Select all
sudo service smbd restart

I don't mind if I make all data available, just so long as they don't have the power to delete stuff. How do I do this?

Make the share read only. Go back into Nautilus > Sharing Options and uncheck "Allow other people to write in this folder"
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby sangre1077 on Sun Oct 03, 2010 1:14 pm

Man i've been trying to get file and print sharing on my linux mint 9 isodora edition can't seem to figure it out some commands aren't working i think i'm some how using both nautilus and samba that might be the reason...

I looked at my smb.conf file and i dont have a global section either.


$ sudo service samba restart
samba: unrecognized service
sarge@sarge-desktop ~ $
that commands says that everytime

Code: Select all
  #############################################################
    # Simple Generic Samba configuration file
    #
    # Written by Mike Tatum for the Linux Mint Forum.
    # 20th May 2008
    # Use at your own peril!
    ###############################################################
    # This is the main Samba configuration file. You should read the
    # smb.conf(5) manual page in order to understand the options listed
    # here. Samba has a huge number of configurable options most of which
    # are not shown in this example
    #
    # Any line which starts with a ; (semi-colon) or a # (hash)
    # is a comment and is ignored. In this example we will use a #
    # for commentary and a ; for parts of the config file that you
    # may wish to enable
    #
    # NOTE: Whenever you modify this file you should run the command
    # "testparm" to check that you have not made any basic syntactic
    # errors.
    #

    #======================= Global Settings =======================

[    printers]
    comment = All Printers
;    browseable = yes
    path = /tmp
    printable = yes
    writeable = yes
    create mode = 0700
    valid users = avahi, sarge

    # Windows clients look for this share name as a source of downloadable
    # printer drivers
    [print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
;    browseable = yes
    writeable = yes
    valid users = avahi, sarge
    # Uncomment to allow remote administration of Windows print drivers.
    # Replace 'ntadmin' with the name of the group your admin users are
    # members of.
    ;   write list = root, @ntadmin

    # A sample share for sharing your CD-ROM with others.
    ;[cdrom]
    ;   comment = Samba server's CD-ROM
    ;   writable = no
    ;   locking = no
    ;   path = /cdrom
    ;   public = yes

    # The next two parameters show how to auto-mount a CD-ROM when the
    #       cdrom share is accesed. For this to work /etc/fstab must contain
    #       an entry like this:
    #
    #       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
    #
    # The CD-ROM gets unmounted automatically after the connection to the
    #
    # If you don't want to use auto-mounting/unmounting make sure the CD
    #       is mounted on /cdrom
    #
    ;   preexec = /bin/mount /cdrom
    ;   postexec = /bin/umount /cdrom


[Public]
    path = /home/sarge/Public
    writeable = yes
;    browseable = yes
    valid users = avahi, sarge

[Downloads]
    path = /home/sarge/Downloads
    writeable = yes
;    browseable = yes
    valid users = avahi, sarge

[Documents]
    path = /home/sarge/Documents
    writeable = yes
;    browseable = yes
    valid users = avahi, sarge


thats my smb.conf file in the beginning mint 9 found my windows printer right after i installed samba by going to add printer and using the command smb://MY-ip and installed driver but got errors trying to use it then messing around more made it wose now I can't find it.
Not sure what avahi is, didn't know what to choose when i had a list just wanted to add my user name and the user for the windows computer.

My workgroup name is linux on both machines the only thing that works is in virtualbox i can share file and folders from this maching but still cant see other machine or access anything on the winXP machine.

Sorry had to run fast just edited my post..
Last edited by sangre1077 on Sun Oct 03, 2010 3:45 pm, edited 2 times in total.
sangre1077
Level 1
Level 1
 
Posts: 9
Joined: Wed Aug 25, 2010 5:50 am

Re: How To - Simple File Sharing in Mint

Postby altair4 on Sun Oct 03, 2010 3:09 pm

Your post is very hard to read because you don't use any periods. I'm 125 years old and need periods to let me know when one thought ends and another begins. Anyway this HowTo is on using Nautilus-shares and you are using Classic-shares. If you start your own post I'll show you how to reset your smb.conf to the original form and maybe help you to your goal.

When you start your own topic you might want to make clearer if you are using VirtualBox or if this is a real install. Oh and just to clear one item up:
sudo service samba restart

It's going to get confusing around here because Debian does it one way and Ubuntu does it another but there is no "samba" service in Mint9 so the command would be:
Code: Select all
sudo service smbd restart


If you were using Mint Debian then the way you had it would have worked:
Code: Select all
sudo service samba restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby AbeFreeman on Tue Oct 05, 2010 4:22 am

Hi Altair,
I definitely want the automount in fstab option, so that the kids can just start up the computer and sign in and have access to the data. But after reading Fred's tutorial and your advice earlier in this tutorial regarding changing a line in fstab to :
UUID=284F243607E75E6A /media/Media ntfs defaults,nls=utf8,umask=000,gid=46 0 1 I am still not sure what to do. Fred said, "The mounting options I used above are typical and can be changed to meet your needs, if you so choose and know what you are doing" Problem is, I don't. And I don't know how to change that, except by asking one of you gurus.... so, Compared to the string above, Fred's example would not have included "nls=utf8", unmask=007 (but I want the 000, if I understood correctly) and the last "1" would be a zero. Fstab shows those as "options" and "pass", but where can I get a description of what the different options are, or what "pass" means?
What I did was use Fred's defaults but with unmask=000, and so far things seem to be working fine (kids can read files but not delete them).
User avatar
AbeFreeman
Level 3
Level 3
 
Posts: 146
Joined: Wed Aug 04, 2010 12:36 am

Re: How To - Simple File Sharing in Mint

Postby AbeFreeman on Tue Oct 05, 2010 4:28 am

'Nother file sharing question:
I had this as a 2nd question in the same post, but realize now I should have split them, as it wasn't clear that I wasn't still talking about sharing my ntfs data partitions, but rather about those programs that store their own data somewhere else. Anki is an example, but there's also Evolution, Thunderbird, Media player playlists, etc, etc. For the Anki example, the kids have used it on the "main" user account and created a bunch of flash-cards that the program stores in /usr/godonlyknowswhere. If I want all users to be able to use that program (or any/all programs) with the same default data files, not each user having a program that acts like a data-less fresh install, how do I do that? WIth the Anki example, I'd like to share the files so that users can modify them, but some other ones, like Thunderbird, I would want read-only access.
User avatar
AbeFreeman
Level 3
Level 3
 
Posts: 146
Joined: Wed Aug 04, 2010 12:36 am

Re: How To - Simple File Sharing in Mint

Postby altair4 on Tue Oct 05, 2010 6:27 am

AbeFreeman, your last two posts have nothing to do with Samba and as this HowTo is about Samba file sharing I would suggest you post a new topic. When you do I would suggest supplying the output of the following commands so folks can help you faster:

Code: Select all
sudo blkid -c /dev/null

Code: Select all
cat /etc/fstab

Code: Select all
mount
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby WinterMint on Mon Oct 18, 2010 11:42 pm

when connecting to a Windows share, how do i enter a folder name with a space in the name for example IT Documents?

thanks
B
WinterMint
Level 1
Level 1
 
Posts: 2
Joined: Thu Jun 03, 2010 2:44 pm
Location: SoCal

Re: How To - Simple File Sharing in Mint

Postby altair4 on Tue Oct 19, 2010 6:51 am

WinterMint, this HowTo is about sharing Mint folders to Windows or Linux. Your question is about access to a Windows share from Mint.

Anyway, I don't know where you are entering the name of the share. From the terminal - from nautilus. If you are entering it from Nautilus then it's:
Code: Select all
smb://192.168.0.100/IT%20Documents


The %20 takes the place of the space.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby MidnightWatcher on Wed Nov 24, 2010 12:43 am

Is there a "How To" anywhere here like this that also shows us how to easily set up NFS shares?
MidnightWatcher
Level 1
Level 1
 
Posts: 42
Joined: Mon Nov 08, 2010 1:20 pm

Re: How To - Simple File Sharing in Mint

Postby Palice on Sun Jan 02, 2011 12:32 am

Hello

I have been reading through this and some other related threads looking for an answer to my problem. I am sure it's just me not properly understanding what to do, but here goes....

I have LMDE on 2 computers, one of which has an external hard drive which I would like to share with the other one.

I have followed the instruction in this thread, and have no problem sharing folders such as "Documents", "Music" ect ect, but when it comes to the external hard drivbe, I constantly get "you do not have the permissions necessary to view the contents of "My Passport". (My Passport is the name of the Hard drive obviously).

I have gone to the Media folder, opened it as Admin and shared the My Passport folder, but that didn't work. I also tried sharing individual folders within the My Passport drive, with no joy there either.

Here is the out put of "net usershare info --long"


Code: Select all
paddy@paddys-laptop ~ $ net usershare info --long
[documents]
path=/home/paddy/Documents
comment=
usershare_acl=Everyone:F,
guest_ok=y

[downloads]
path=/home/paddy/Downloads
comment=
usershare_acl=Everyone:F,
guest_ok=y

[music]
path=/home/paddy/Music
comment=
usershare_acl=Everyone:F,
guest_ok=y

[media]
path=/media
comment=
usershare_acl=Everyone:F,
guest_ok=y

[pictures]
path=/home/paddy/Pictures
comment=
usershare_acl=Everyone:F,
guest_ok=y

[my passport]
path=/media/My Passport
comment=
usershare_acl=Everyone:F,
guest_ok=y

[aussies]
path=/media/My Passport/Aussies
comment=
usershare_acl=Everyone:F,
guest_ok=y

[public]
path=/home/paddy/Public
comment=
usershare_acl=Everyone:F,
guest_ok=y



Any assistance in this would be greatly appreciated.

Thank you!
Palice
Level 1
Level 1
 
Posts: 22
Joined: Sat Feb 14, 2009 12:51 pm

Re: How To - Simple File Sharing in Mint

Postby altair4 on Sun Jan 02, 2011 8:40 am

The problem with the external hard drive is most likely not a Samba issue but a Linux file permissions issue. If "My Passport" holds an NTFS or FAT32 formatted partition then it will mount with you as owner and with read / write permissions only for you and no one else. When you created your share you allowed guest access. "Guest" is not you so access is denied. You can have samba fix this issue by creating a mask that will convert "guest" to you - at least as far as that share is concerned:

Edit smb.conf as root:
Code: Select all
gksu gedit /etc/samba/smb.conf

Add the following line to the [global] section of smb.conf:
Code: Select all
force user = your-mint-login-name

Save the file and restart samba:
Code: Select all
sudo service samba restart
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
altair4
Level 15
Level 15
 
Posts: 5926
Joined: Tue Feb 03, 2009 10:27 am

Re: How To - Simple File Sharing in Mint

Postby Palice on Mon Jan 03, 2011 5:52 am

Thank you altair4.

You pointed out something I should have noticed....it was an NTFS file system. Usually I re format all my external hard drives before I use them, but I forgot.

Reformatting as I type this, and will post back with the results.

I have read some of your posts on this forum, and you are most learned and patient, thank you.
Palice
Level 1
Level 1
 
Posts: 22
Joined: Sat Feb 14, 2009 12:51 pm

Re: How To - Simple File Sharing in Mint

Postby Palice on Mon Jan 03, 2011 7:27 am

All done, re formatted to ext 4 and now there are no problems.

Thanks again.
Palice
Level 1
Level 1
 
Posts: 22
Joined: Sat Feb 14, 2009 12:51 pm

Linux Mint is funded by ads and donations.
 
PreviousNext

Return to Tutorials / Howtos

Who is online

Users browsing this forum: No registered users and 15 guests