Samba Permissions Again

Hello, please figure out how to share the folder to only special user? For example I have two computers host1 with users: user1, user2, user3 and host2 with same users: user1, user2, user3, how to share “test” user2 folder form host1 to only user2 from host2 ?

My system is openSuse 11.1. There is all I’ve understood:

host1
[test]
inherit acls = Yes
path = /home/user2/test (drwxr-xr-x)
read only = No
guest ok = Yes
read list = user2
valid users = user2
admin users = user2

host2
mount –t cifs //host1/test /home/user2/test

It works but either user2 from host2 can’t write to «test» share on host1 (drwxr-xr-x) OR all can write in this share (drwxrwxrwx).

I’ve googled it, searched here and read this: Chapter 16. File, Directory, and Share Access Controls, but without successes.

Please, help!

Read help site maintained by swerdna for this.
Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 11.x

By the by, if you are not using Windoze, why use samba?

Thanks for reply.

But I do not use Windows. I have a cluster of two nodes under openSUSE. I need common user directory for both nodes. For example when I log in through ssh to one of this nodes as user1, I should have same home directory as if I do it with same user1 to another node.

As I say before I’v done it but I stuck with the permission issue.

I use samba only because I have no experience with NSF.

djurin wrote:
> But I do not use Windows.

but, samba is for use between windows and linux…why would you even
try to use it between linux and linux?

would you use PlayStation program to network linux to linux??


palladium

Because I have no experience with NFS. But I know samba a little. And i’m shire there is possibility to mange my problem with Samba.

Ok, I will try to do it with NFS.

Ok, I start an NFS Server on the node1 and set for export the user home directory: /home/user1 (drwxrwxr-x)
Host Wild Card: * rw, root_squash,sync, no_subtree_check

On node2 I successfully mount this directory to the home directory of identical user:

mount -t nfs node1:/home/user1 /home/user1/test

But again I cant write to this directory! What’s wrong?

I know nothing about nfs but have you checked the UID’s of the users on each system?

user1@system1 must be the same as user1@system2:

use this command: id <username> on each system, make sure UID is the same.

I’ve resolved my infantile problem! :slight_smile:
Yes I’ve checked user ID on both nodes, it’s not the case. My problem was that i was trying to write as root user! When I do it as user1 shared folder become writeble! Funy, but root user is not such powerful as I thought :slight_smile:

Yes, there’s a reason for that. It’s a security hole if root has write permission on remote filesystems. See the root_squash option in mount.

djurin wrote:
> I’ve resolved my infantile problem! :slight_smile:
> Yes I’ve checked user ID on both nodes, it’s not the case. My problem
> was that i was trying to write as root user! When I do it as user1
> shared folder become writeble! Funy, but root user is not such powerful
> as I thought :slight_smile:
>
>
let me guess that you have a lot of experience on another operating
system, and not lot on Linux…and, suggest you try to believe this:

the more experience you have on another operating system the harder it
is to come to grips with the “Linux way”…and the more often you
try to use your experience on another system the harder you are gonna
find it to proceed smoothly and happily on Linux…

with that in mind, and hoping to be helpful i offer for your
consideration:

don’t log into KDE, Gnome or any other *nix desktop environment as
root…not even once, because as far as i can tell there is always
a better, safer, more secure and less destructive way to “become root”
while logged in as a user…

now i know there is a popular notion: it is my machine and i will use
it as i wish…to which i say, more power to you…do administrator
duties logged into the other system’s desktop as administrator,
ok…but not here, please read more here:

http://en.opensuse.org/SDB:Login_as_root
http://docs.kde.org/stable/en/kdebase-runtime/userguide/root.html
http://tinyurl.com/6ry6yd
http://tinyurl.com/ydbwssh

one of the reasons Linux is more secure than some other systems is the
simple division of labor between user and root…

ymmv (and so will your security)


palladium

I know a little about root user paradigm on *nix systems. My idea was that with root you always have less restrictions, less settings should adjust correctly. So, in this case, I use root to simplify my problem only, as a first step. Nevertheless, thanks for post and links!