Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

student@mylamp:/test$
share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.