Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created a directory test owned by the root user, and then I created a file called F1 inside test , now I need to create a file called T5 inside test but by a user called student

What is the command to do that?

This what I did:

root@mylamp:/# mkdir test
root@mylamp:/# touch F1

Now I need to access test by the user student to create F5

share|improve this question

At first, I think you should edit your question and make it more readable. What you are looking for are either chmod, chown or setfacl.

a) chmod

You can modify the permissions for the directory "test" with chmod in order to give another user access to it.

For instance, you could do

chmod 777 test

Now everyone has write access to this directory, also your student user. Please be aware that you are giving away more permissions than you might like.

b) chown

Put the user student into a group and do

chown root:studentgroup test

Afterwards make sure that groups may write into that directory:

chmod 774 test

c) setfacl

Another approach could be to use ACLs. ACLs are made for a more complex permissions management. You can use setfacl to manage the permissions for a directory or file. For example you can run the following command:

setfacl -m u:student:rwx test

This command ensures that the user student has read, write and execute permissions on test. Please note that this only works when the underlying file system was mounted with ACL support (see /etc/fstab).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .