LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-27-2007, 08:21 AM   #1
safapombo
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Rep: Reputation: 0
Ubuntu - Samba folder permission


Hello!

I need a bit of help here. I have installed Ubuntu Server edition dual boot with Windows XP.
I mounted my shared partition on fat32.
When it is booted in Ubuntu, the users (all windows) can't access to it, only the first user i created can. I managed to let another user access the shared folders in Ubuntu (the fat32 partition), and added that user in Samba (smbpassword -a username). Then edited the smbconfig, and gave write list and valid users those two usernames. But my second user can't access anything yet, he/she can access those folders when logged on in ubuntu, but not over the network with Samba's username and password.

Am i making myself clear? Can anyone help?

Thank you very much!!
 
Old 04-27-2007, 09:04 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Is the share located on the Ubuntu server? If so, make sure that the you allow "o" others to read/write to the directory. You don't want the Linux permissions of the directory to be more restrictive than the share.
There are several things that you left out of your post. Is the share one that anyone can access? Are you using SECURITY=share or SECURITY=user?

Look and see if you have a samba-doc package. If not, maybe you still have 3 books supplied by the samba package instead. If not, you can download the book "Samba 3 by Example". One of the first two examples may resemble what you want to do. For example, there is a share that allows guest access. To make things simple, it uses "force user" and "force group" to match the user/group ownership of the directory:
Code:
# Global Parameters − Newer Configuration
[global]w orkgroup = MIDEARTH
printing = CUPS
print cap name = CUPS
map to guest = Bad User
show add printer wizard = No
wins support = yes
[FTMFILES]
comment = Funds Tracking & Management Files
path = /data/ftmfiles
read only = No
force user = abmas
force group = office
guest ok = Yes
nt acl suppor t = No
[office]
comment = General Office Files
path = /data/officefiles
read only = No
force user = abmas
force group = office
guest ok = Yes
nt acl support = No
[printers]
comment = Print Temporary Spool Configuration
path = / var / spo o l /samba
printable = Yes
guest ok = Yes
use client driver = Yes
browseable = No
These steps where used to create the shares:
  1. Create a group account for office file storage:
  2. Create a user account for office file storage:
    root# useradd -m abmas
    root# passwd abmas
    Changing password for abmas.
    New password: XXXXXXXX
    Re-enter new password: XXXXXXXX
    Password changed
    where XXXXXXXX is a secret password.
  3. Create a mount point for the file system that can be used to store all
    data files. Create a directory called /data:
    root# mkdir /data
    root# chmod 755 /data
    The 755 permissions on this directory (mount point) permit the owner
    to read, write, and execute, and the group and everyone else to read
    and execute only.
  4. format the partition with a suitable file
    system. (Note: You didn't need to use fat32 for a windows client to access the share. A linux filessytem would be more suitable because you don't need to set the permissions and ownership in the mount command. I would recommend changing to a Linux native filesystem.)
  5. Under the directory called /data, create two directories named ftmfiles
    and officefiles, and set ownership and permissions:
    root# mkdir -p /data/{ftmfiles,officefiles/{letters,invitations,misc}}
    root# chown -R abmas:office /data
    root# chmod -R ug+rwxs,o-w,o+rx /data
    ([SIZE="1"]Note: I you use fat32, you can't use the chmod command. How will you set the sticky bit to protect files from deletion by other users.)

If the partition is fat32 so that you can access it when running windows on the machine, then you can use the "umask" and "fmask" option on the partitions entry in /etc/fstab.

If you are using "security = user" look in the smb.conf manpage for "write list"
Code:
       write list (S)
          This is a list of users that are given read-write access to  a  ser‐
          vice. If the connecting user is in this list then they will be given
          write access, no matter what the read only option  is  set  to.  The
          list can include group names using the @group syntax.

          Note that if a user is in both the read list and the write list then
          they will be given write access.

          By design, this parameter will not work with the security = share in
          Samba 3.0.

          Default: write list =

          Example: write list = admin, root, @staff
Good Luck!

Last edited by jschiwal; 04-27-2007 at 09:14 AM.
 
Old 04-27-2007, 09:28 AM   #3
safapombo
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Original Poster
Rep: Reputation: 0
The thing is, i cant change the folder permissions to give others rights, i have tried a hundred times, but i cannot, not through the interface and not through the command line...

I'll check the rest and i'll keep posting anyway.

Thanks!
 
Old 04-27-2007, 09:31 AM   #4
safapombo
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Original Poster
Rep: Reputation: 0
By the way, i have security = user and all the users in the write list option for the folders being shared.

About the filesystem, i heard that the only way that Linux AND windows can read and write into a file is if the filesystem is fat32????
 
Old 04-28-2007, 12:38 AM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Quote:
Originally Posted by safapombo
By the way, i have security = user and all the users in the write list option for the folders being shared.

About the filesystem, i heard that the only way that Linux AND windows can read and write into a file is if the filesystem is fat32????
This is true for a local partition, when you dual boot between Linux and Windows. It isn't the case for a samba share. You can share directory on a Linux filesystem, and the other windows computers will be able to write to it. It is Samba that does the writing to the filesystem.

What is the "ls -ld" listing of the directory that you are sharing. If you use the "umask" and "fmask" options you can enable others to write to the disk. Then using "read only = no" may enable the user to write to the disk. There is also the "write list =" entries.

Also check the samba logs. They may indicate why access is denied.
 
Old 04-30-2007, 02:48 AM   #6
safapombo
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Original Poster
Rep: Reputation: 0
Hello jschiwal!
It made it work. I read somewhere that all the computers had to be in the same workgroup, i didnt have the server in a workgroup, joined it and worked!

Thank you very much for your help!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
samba: permission for sharing public and private folder zamri Linux - Software 16 02-02-2011 07:49 AM
Problem in samba at windows machine(Folder Permission) RajendraKumar Linux - Enterprise 2 07-31-2006 03:19 AM
Problem in samba(Folder Permission) RajendraKumar Linux - Software 1 07-30-2006 10:11 AM
File, Folder permission and SAMBA Steve1445 Linux - Newbie 2 01-15-2004 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration