I'm trying to set up a series of local directories on an OSX 10.9 machine which is connected to a windows domain. I have set the folders to have the correct permissions.
for example the "INTAKE07" directory has read/write permissions for any users in the network group INTAKE07. But whenever a user from this group makes a new subdirectory it only has read/write permissions for the owner and not for that network group.
I believe I the answer might be something to do with umask, but I have no idea.
Any help will be appreciated. Thank you
Sorted it with this command in the end:
chmod +a "group:DOMAIN_NAME\Intake07 allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /path/to/folder
Related
I've set up WSL (Windows Subsystem for Linux) on my Windows 10 to utilize Bash. I've created a Linux user, installed the latest updates and upgrades, and I know how to access the Windows files through /mnt/c/Users etc. When I try to create a new file on my desktop, it denies permission:
rupert#DESKTOP-GT4APR9:/mnt/c/Users/zolta/OneDrive/Desktop$ touch
file.txt touch: cannot touch 'file.txt': Permission denied
How can I grant my Linux Bash user permission to create and modify files and directories on my Windows user desktop? Is that possible at all?
I would use sudo, i.e. sudo touch file.txt. Works for me in WSL2 Ubuntu (which is Debian based)
The path with which you are having problems,
rupert#DESKTOP-GT4APR9:/mnt/c/Users/zolta/OneDrive/Desktop
appears to live on OneDrive: While I am not a OneDrive expert, my understanding is that to access it from the command line, the remote data stored on OneDrive has to synced locally.
If you cd rupert#DESKTOP-GT4APR9:/mnt/c/Users/zolta, can you touch file.txt there?
What about accessing these folders from cmd or pwsh?
By default, on a brand new Windows 10 install, the user sub-directories (Desktop, Documents, etc...) are located within the OneDrive directory, inside the home directory (that is troublesome in my opinion).
It will allow synchronisation between devices.
I do not know if WSL is able to access such a directory, like it cannot access USB storage for exemple.
You may want to ls first in order to see if you can access:
ls -alh /mnt/c/Users/zolta/OneDrive/Desktop
If you can see your files, that is a write access issue. You might correct it by changing the owner or the directory and it's content:
sudo chown -R $USER:$USER /mnt/c/Users/zolta/OneDrive/Desktop
If you cannot, try using sudo:
sudo ls -alh /mnt/c/Users/zolta/OneDrive/Desktop
If nothing can be seen, or an error raise, that probably means WSL cannot access this directory.
In that case, I suggest you change default directory as stated in the Microsoft documentation.
I have a DS218+ Synology NAS and Mac. I am successful in being able to sync the two with rsync but during the process the folder/file owner and group get changed.
Initially I let rsync create the folder by not appending a / to the end of the paths. In this case I got an owner and group as numbers 502 & 20 respectively. I adjusted by adding the / and creating the top level folder on the NAS via the DSM. Initially the NAS folder has the correct owner and group but post rsync it goes back to numbers as indicated above.
rsync -rltgoDvh --chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r --delete --exclude='.DS_Store' /Users/Chris/CDs/ user#ipaddress::NetBackup/CDs/
I would like the folder/file owner and group to be as if they were created by that account locally on the NAS. My next guess will be to remove "go" from the options in the rsync command but thought someone smarter than me might see through to the correct approach.
I may be misunderstanding your requirement, but -p/--perms preserves the original file permissions.
I normally use -a/--archive mode, which is equivalent to -rlptgoD, according to man rsync.
I need to set the permissions of just 3 specific folders (on my Mac) to 777
I went to CMND+i (get info) but the folder permissions seemed to be Read and Write - but this didn't seem to fix it.
I am trying to work out how to do this, because I am using MAMP on my Mac to try and run a localhost server to test a website. Reason; I am trying to run the script of a PHP website. It is asking me to change the permissions of certain folders in order to proceed with the 'install'.
I think the closest match to a possible answer is here:
Java: Create a new dir with 777 permissions on Mac
But, this appears to be Java. I assume that I need to be able to do this via either MAMP or Terminal. If anyone could please advise me which program/tool to use and what to type in, I'd be very grateful.
Thanks
I know how to do it in a terminal, to create "/some/directory/some/where" you can use -
# EDIT: 777 not 077.
mkdir -p /some/directory/some/where && chmod 777 /some/directory/some/where
I have doubt in directory undeletable concept. In Windows operation system, we convert a Undeletable file or folder in to deletable by using the command as "cacls FolderName /e /c /g %username%:f". I used the same command to access the "Undeletable folders" (for example Recovery, Documents and Settings etc.,), which is present in the C: drive. It doesn't work. How they create this kind of folders. If any other ways to do this. Kindly clear me. Thanks in advance.
Those folders have the "list folder/read data" permission set to deny for everyone. Deny takes precedence over allow, so it doesn't matter what permissions you give to a user: the deny setting will overrule it. You have to remove that setting first, which probably means you also have to take ownership first. They're owned by SYSTEM.
We have two users:
user1
user2
They both belong to the group 'admin'.
We have a directory that has been set to 775. The directory's group has been changed to 'admin'. Each user has full access to write into that directory, though when a user writes a new file to the directory, the group permissions of the folder are not persisted to the file that was written.
How should we make it so that files inherit the directory's group permissions?
Clarification: when a new file or directory is written, it uses the users' group as the group of the new file, rather than that of the directory, which makes sense - but how do I not make that happen?
You can propagate group permissions by setting the directory's setgid bit (chmod g+s). This may not be portable across all *nixes and all file systems.
http://en.wikipedia.org/wiki/Setuid#setgid_on_directories
http://www.gnu.org/software/coreutils/manual/html_node/Directory-Setuid-and-Setgid.html
If you are using ext3 or ReiserFS, this page about creating a Linux file server may help. Specifically step 7 suggests the following command.
setfacl -d -m g:sales:rw /groups/sales
I think you should look here.
As the site says, "Unix doesn't support the idea of inherited permissions."
However, there is a section on ACLs (Access Control Lists), which I think is what you are looking for. By setting up an ACL, you can have your files inherit the same ACL from the directory, which I think is what you are asking for. setfacl is the shell command that will be what you need to look into.
Hope that helps!