LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-12-2013, 06:19 AM   #1
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Rep: Reputation: Disabled
Question Samba Users & Log File Issue


Samba Users & Log

I'm using Ubuntu 10.10 with samba enabled in it, every staff member has his own UserId & Password. I'm using user nobody and nogroup so may the shared files can be used by every one. Now the problem is that i'm also making samba audit log by Sambauser & Ip address and it's making with log with user nobody.

I have changed my shared files with user & group root by doing this my log is working fine i mean that it's making with the user name, but the problem is if User A is making any file so it's read only to User B.


Kindly let me know the solution.
 
Old 03-12-2013, 06:28 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
You can add main group of user A as supplimentry (secondary) group for user B. It should possibly solve the pb.
To check user A's primary group:
Code:
~$ id -a A
To add user B to main group of user A:
Code:
~$ usermod -G <groupname> B
 
Old 03-12-2013, 07:45 AM   #3
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Original Poster
Rep: Reputation: Disabled
is it necessary to change shared files permission from no body to root ??

and i have a group named Admin-Department,User A & User B are the member of that group but still i'm facing the same problem??

and i have more than 100 users so what should i do ??
 
Old 03-12-2013, 08:01 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
- Is Admin-Department a primary group for both A and B?
- If Admin-Department is primary for both, then does file(s), created by A, have full permissions for group?

Well, if addition of a user to main group of the file solves the problem, then you can add all 100 users to the group (don't worry, a simple script will do that).
 
Old 03-12-2013, 08:18 AM   #5
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Original Poster
Rep: Reputation: Disabled
User A & User B both are the members of that group but i dont have any idea about primary groups..??

& i have given User=root & group=root to my files, and if User A created any files is read only to user B and both are the members of same group.

I have created few groups just like admin-department, Tax-Users, Audit-Users & Corporate-Users and i have added my users to these groups but i don't have any idea about primary group,

can i do this that first i create new group and add all user to that group and make it users primary group, will it solve my problem ??
 
Old 03-12-2013, 08:57 AM   #6
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
First of all post output of:
Code:
~$ id -a A
~$ id -a B
You can see, if a file has root:root as owner and group, and group has only read permission, then how files can be copied? Files created by user A should have A as owner and A's primary group as main group for the file. Then if user B wants to copy that file, then B should be in main group of the file OR the file should have read/write permissions for group as well others.

Once check manual of following: chmod and chown
 
Old 03-13-2013, 01:14 AM   #7
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Original Poster
Rep: Reputation: Disabled
Quote:
user A (Which is Majid)

uid=1000(majid) gid=1000(majid) groups=1000(majid), 0(root), 4(adm), 20 (dialout), 24re), 115 )admin), 1027 (Taxusers), 1028 (IT-Department), 1029 (corporate), 1030 (admin-department)


User B (Which is mahmood)

uid=1004 (mahmood) gid=1005(mahmood) groups=1005(mahmood), 0 (root), 1027(Taxusers), 1030 (admin-department)
These are the outputs and as you can see that both are the members of Taxusers & Admin-department groups
 
Old 03-13-2013, 01:42 AM   #8
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Add user mahmood to primary group of majid, as:
Code:
~$ usermod -G majid mahmood
After that, using user A i.e. majid, create a file sample.txt (don't change file's owner or group), and do:
Code:
~$ touch sample.txt
~$ chmod g+rwx sample.txt
Then try user B i.e. mahmood, to access or copy the sample.txt file and let's know the result.
 
Old 03-13-2013, 02:15 AM   #9
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Original Poster
Rep: Reputation: Disabled
I did the same thing as you said, i can copy, move and delete the file, but files are still read only.
 
Old 03-13-2013, 02:20 AM   #10
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
File permissions do not change if you move or copy them, but it remains what was set originally.

If a file has read only permissions, then first change it to r/w and then try to copy or move. Also check user A i.e. majid's umask value, becuase all files created by majid will get their permissions assigned on basis of umask value set in majid's profile.
Code:
~$ grep umask /home/majid/*
 
Old 03-13-2013, 02:57 AM   #11
gemmajid
Member
 
Registered: Mar 2012
Location: Karachi
Distribution: Ubuntu, RedHat, CentOs,
Posts: 95

Original Poster
Rep: Reputation: Disabled
I have changed my Unix File & Directory mode to 755 to 777 and the read only issued is resolved, but now my samba recycle is not working..
 
Old 03-13-2013, 03:09 AM   #12
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Quote:
Originally Posted by gemmajid View Post
I have changed my Unix File & Directory mode to 755 to 777 and the read only issued is resolved, but now my samba recycle is not working..
Do not change permissions of each & every file to 777, but only for those files which you want to give full permission to user B i.e. mehmood. Revert change for any other files.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Shell script to monitor the log file & kill the process if log is not updating. milu_k Programming 5 07-19-2012 09:23 AM
[SOLVED] Samba File Serve & Win Domain Users hesisaboury Linux - Newbie 15 11-05-2011 01:14 PM
samba file permission & build_sam_account issue in samba cnt Linux - Server 5 08-10-2011 02:19 PM
[SOLVED] samba : how to synchronize AD users & groups with Samba users &groups zelycorn Red Hat 5 05-12-2011 10:15 AM
Samba - If I use @valid users, only root can log in essdeeay Linux - General 6 04-10-2006 02:05 PM


All times are GMT -5. The time now is 06:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration