خرید بک لینک

I am in to the process of setting up a new machine (ubuntu2) in which two users will login (let's name them user1 and user2). To manage the machine I have added a third user 'admin'. All users are all members of the same group (users).

On this machine the admin user permanently mounts a samba share shared by another ubuntu machine (ubuntu1) (the choice for samba was made as this share will also be mounted by windows and mac machines).

The relevant section in the smb.cnf on ubuntu1:

Code:

[Linux-Share-01]
  guest ok           = no
  path               = /storage/shared
  valid users        = @users
  write list         = @users
  force group        = users
  force directory mode = 0775
  force create mode     = 0775
  browsable          = yes
The mount sequence in fstab is as follows:

Code:

//ubuntu1/Linux-Share-01 /mnt/Linux-Share-01   cifs    credentials=/home/admin/.smbcredentials     0     0
This set-up already brings me quite a long way to where I want to go. The share 'Linux-Share-01' is mounted using the credentials of the admin user. When user1 and user2 log into the machine, they can both read from and write to the share by accessing /mnt/Linux-Share-01.

Currently, the files written by user1 and user2 on the share will be owned by the 'admin' user:

Code:

-rwxrwxr-x 1 admin users    0 mrt 11 19:13 x.dat
My question: is there a way to modify the current setup (or implement a different setup) that will allow the two users to access the share such that the files they create are fully owned by the respective user? The desired output would read like this if both users would create a file on the share:

Code:

-rwxrwxr-x 1 user1 users    0 mrt 11 19:13 x.dat
-rwxrwxr-x 1 user2 users    0 mrt 11 19:13 y.dat
Many thanks!

برچسب: نویسنده: استخدام کار تاريخ: شنبه 22 اسفند 1394 ساعت: 2:32

صفحه بندی