How we can set read/write permission for user1 and read only for user2?

How we can set read/write permission for user1 and read only for user2?

2 Answers

  1. Create a new group that contains only the users you want to have access: groupadd newgroup.
  2. Assign each of those users to that group: usermod -G newgroup user1. usermod -G newgroup user2.
  3. Change ownership and permissions of the directory, do this for each folder: chown user1:newgroup FOLDER_EXAMPLE.

What does chmod 770 mean?

owner
770 means owner and group have full permissions. 777 means all (user group other) have full permissions on this directory.

How do I restrict access to box?

Click Settings to open the Folder Settings page. Here you can restrict shared link access to collaborators in this folder only. Check the box under Shared Link Access and choose what item types you’d like to restrict access for – both files and folders, files only or folders only.

How to give read only permission for specific user for specific folder?

The easiest way is probably to add user2 to user1’s group, and then remove group write access from all of user1’s files and directories. Remember, in order to go into a directory and view its contents, you need both read and execute permission on the directory.

How to give user access to only one directory?

You need to make all the files that the user needs (e.g. mysql and all its dependencies, if you want the user to be able to run mysql) under the chroot. Say the path to the chroot is /home/restricted/abcd; the mysql program needs to be available under /home/restricted/abcd.

What’s the difference between write permission and write permission on a directory?

Write: The write permission gives you the authority to modify the contents of a file. The write permission on a directory gives you the authority to add, remove and rename files stored in the directory. Consider a scenario where you have to write permission on file but do not have write permission on the directory where the file is stored.

How are file permissions divided in a Linux system?

Linux being a multi-user system uses permissions and ownership for security. There are three user types on a Linux system viz. User, Group and Other Linux divides the file permissions into read, write and execute denoted by r,w, and x