Score:0

files and folder created by a user get ownership of a differnt user when created at specific location

nl flag

I have a folder /vagrant which is owned by user vagrant who is in group vagrant.

then if I switch to user root or ansible user and create a directory at /vagrant path. it gets ownership of vagrant:vagrant

drwxrwx---  1 vagrant vagrant       0 Feb 19 08:46 etc

Since it was created by root I was hoping that it would be owned and in root group, I tried the same with ansible user who is also part of vagrant group but even then the user and group are vagrant as in case of root. What I want is to be able to set any user own file or folder!

Update:

# ls -ld /vagrant
drwxrwx--- 1 vagrant vagrant 8192 Feb 19 08:46 /vagrant

so others doesnt have any rights but the ansible user is in the vagrant group.

hu flag
...and what is the output of `ls -ld /vagrant`?
Chang Zhao avatar
nl flag
@mikewhatever , I see the vagrant folder doesnt have permission set for others, so which is probably why but ansible user is in the vagrant group.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.