A question about default groups & permissions for uploaded files
I've never quite got this, so maybe someone can help out.
I installed a new drive for storing ISOs & VMs. Got it mounted at /kvm and created the directories /kvm/iso & /kvm/vm. This is as root, so the directory looks something like this: drwxr-xr-x 5 root root 4096 Oct 2 23:21 ./ drwxr-xr-x 24 root root 4096 Oct 2 22:48 ../ drwxr-xr-x 2 root root 4096 Oct 2 23:21 iso/ drwxr-xr-x 2 root root 4096 Oct 2 23:21 vm/ I want to copy files using scp, and authenticating as a non-root account (drunk) that's in the libvirtd group. Because I'm lazy, I want that copied file to automatically have its group and permissions set for libvirtd so KVM can use it without having to run a chgrp/chmod on the file directly. So I change the group of iso: sudo chgrp libvirtd iso And change the permissions on the directory: sudo chmod 770 iso And I can copy up a file: scp ubuntu-12.04.3-server-amd64.iso drunk@remote:/kvm/iso I can see the file up at its destination drwxrwx--- 2 root libvirtd 4.0K Oct 2 23:29 ./ drwxr-xr-x 5 root root 4.0K Oct 2 23:21 ../ -rwx------ 1 drunk drunk 665M Oct 2 23:31 ubuntu-12.04.3-server-amd64.iso* So, my question is 1) How can I get that directory configured so new files automatically belong to the libvirtd group? 2) And that the group permissions are set to rwx? Is this possible? Thanks! |
if you log into the system as user "drunk" via scp than anything uploaded will automatically belong to user "drunk" ;)
|
Quote:
If I'm forced to make the extra step of changing the group & permissions, that's fine. I was just hoping there was a way around having to do that all the time. |
Quote:
|
Code:
chmod g+s dirname |
Quote:
After about 3-4 hours of playing around with umask and acls, I think I finally got default permissions to work as I wanted. It probably took 2 hours longer than it should have because I was copying files from cygwin, and that seemed to be the root cause of why it wasn't setting any of the group/other permissions. On a lark, I tried using scp from linux to copy a file over, and I got the permissions I wanted. |
Thought that would be it :)
I'd stick to using scp or pscp from putty toolset if you've got a win client or even Filezilla; a nice gui using sftp :) If you use Filezilla, do tell it port 22 or it'll use ftp instead :) |
All times are GMT -5. The time now is 02:34 PM. |