Author Topic: Samba Share - Can't write to my own folder  (Read 8502 times)

Offline googy

  • Full Member
  • ***
  • Posts: 51
Samba Share - Can't write to my own folder
« on: February 11, 2010, 10:03:13 AM »
Had this working great for a year or more until I decided to upgrade PCLOS.  JK I love it. LOL

Small home network

Linux desktop acts as file server for a Vista laptop on the home network
User name/PW in user accounts on both machines machines the same
Using my laptop, I used to be able to save to my network drive (Samba Share - Linux File Server)
Now, I cannot WRITE to my network drive - I can browse and read, but can't write.

OK - Did the following
Followed Samba setup tutorial (Crissy) - Same problem

When trying to write to /home/UserName folder, get permissions error

Also, when trying to add Samba User, it doesnt "stick" - list goes empty after OK

Appreciate any help

Online muungwana

  • Hero Member
  • *****
  • Posts: 6237
Re: Samba Share - Can't write to my own folder
« Reply #1 on: February 11, 2010, 10:55:46 AM »

It is not wise to share home directories. create a sharing folder like "/home/UserName/share" and use that folder instead.

folders are usually created with read/write permission to the owner, read only to group and other. You problem is probably due to reading only permission to the "other" group.

Open the shared folder->properties->permssion tab and set "others" to be able to view and modify contents
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..

Offline jwt873

  • Full Member
  • ***
  • Posts: 150
Re: Samba Share - Can't write to my own folder
« Reply #2 on: February 11, 2010, 12:13:40 PM »
Like muungwana says, it's not a good idea to share your home directory..  If you do, it would be best to do it on a network that's behind a dedicated firewall.. 

Check your /etc/samba/samba.conf file....    The section dealing with your '/home' section should have the following.

read only = No
guest ok = Yes

Registered Linux user #166905 -- Registered on 2000-02-21 02:52:05 -- https://linuxcounter.net/

Offline Xero

  • Sr. Member
  • ****
  • Posts: 468
Re: Samba Share - Can't write to my own folder
« Reply #3 on: February 12, 2010, 06:32:41 AM »
 The folder being shared from linux machine, does it have read/write permissions for everyone? I'll bet it's permisions related.
There is no shame in saying "I don't know".

Offline travisN000

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1758
Re: Samba Share - Can't write to my own folder
« Reply #4 on: February 13, 2010, 11:13:08 AM »
I have found the easiest way to bypass the issue is to mount the share using credentials of the primary owner of the share (on the server)...

To create a permanent mount at boot using /etc/fstab :
Quote
Permanent Mounts: Secure shares (username & password required)

Some Vista and Windows 7 shares and many Samba Linux shares require credentials in the form of username/password pairs before access is granted. These credentials are set on the server. In Windows Vista and Windows 7 they are the login username and password of the owner on the server and in Linux they are any member of the Samba User Database on the server who is "allowed" by the file that defines the share.

You use the option string username=server_user,password=user_password instead ...as follows:

Code: [Select]
//192.168.44.100/share   /path_to/mount   cifs   username=server_user,password=secret,_netdev   0 0
Once again, you could use the alternate form //server/share instead of //IPaddress/share for the address.


Source: http://opensuse.swerdna.org/susesambacifs.html



EDIT:  Sorry, I just re-read the original post and noticed that you are using a Windows client..  /etc/fstab probably won't help!  :P ::)

..in your situation the following should be more helpful (same source)..  the very last piece tells how to set up your samba user credentials from command line; if it also fails is should give more info as to why:

Quote
Shares secured by credentials on a server

These shares always require authentication built into the mount process.

A typical read-only share for guests looks like this in the samba configuration file at /etc/samba/smb.conf:

Code: [Select]
[share]
path = /path_to/share

The typical read/write share should look like this:

Code: [Select]
[share]
path = /path_to/share
force user = server_user
read only = no
The directory "share" and all its contents are owned by user "server_user". Permissions on the directory are drwxr-xr-x. The user on the client will see the files as belonging to users on the client, and the "force user" parameter is a simple device to keep things tidy on the server. The credentials that must be passed to the server from the client during the mount are username=server_user,password=secret.

You must add the user "server_user" to the samba user database on the server to allow these shares to work, using the command smbpasswd. Here's the dialogue (as ROOT):

Code: [Select]
smbpasswd -a server_user
New SMB password: secret
Retype new SMB password: secret
Added user server_user.

« Last Edit: February 13, 2010, 11:32:27 AM by travisn000 »

Offline googy

  • Full Member
  • ***
  • Posts: 51
Re: Samba Share - Can't write to my own folder
« Reply #5 on: February 22, 2010, 08:18:16 PM »
OK Now can read and write thanks to travis. 

One question, tho re: the "you shouldn't share your /home/user folder....
How do I "see" my own files on the Linux server without creating a Share?

3 useres use the linux machine as a file server for thheir own files. 

How would you suggest setting up the share?

I thought that if I shareed /home, then each user could "cascade" to their own folder from /home

No???

Online muungwana

  • Hero Member
  • *****
  • Posts: 6237
Re: Samba Share - Can't write to my own folder
« Reply #6 on: February 22, 2010, 09:01:09 PM »
OK Now can read and write thanks to travis. 

One question, tho re: the "you shouldn't share your /home/user folder....
How do I "see" my own files on the Linux server without creating a Share?

The problem with this is that you could create a "personal" folder with your "personal" stuff in "/home/user/.secrets" and your business will be accessible over the network.

if you create a special folder inside your home folder for sharing called "share"(/home/user/share), you will be able to host files and folders over your network in this one folder and have your personal stuff off the network for your "personal" use

sharing a home folder just increases the risks of stuff happening over the network and that is why it is advised to create a dedicated folder for sharing to reduce the risk.

You know best how you work and sharing your home directory may work best for you, you should do that if that will increase your efficiency but you should be aware of potential risks
.. 3 things are certain in life : death, taxes and software bloat ..
.. tell me something i don't know, something i can use as i struggle to reason with the world around me ..