I want to add user called user
on my ftp server, and that user will have access on just /home/user
folder...And I want to he hasn't got access in back folders, home, root and that, just /home/user
but I don't know every command. How can this be done?

- 67,791
- 32
- 179
- 269

- 1
- 1
1 Answers
Most of these commands need to be run as root by the way, so for instance instead of chmod ...
, it would be sudo chmod...
This all depends whether this of restricting access to folder or allowing access to folders. This is on the chmod page, which is what makes it really useful:
Owner is the permissions on that file of the owner of the folder - usually the user that has created them - can be changed with chown
.
Group is the permissions on that file of the group of the folder - can be changed with the chown
or the chgrp
commands.
Other is the permissions on that file of everyone who does not fall into the above two categories.
So running chmod 600 /PATH/TO/FILE
will change the permissions so that only the owner can read the file, and write to it. This is useful if ristekga
is the only other user, as then they cannot access it, but the owner can.
You can also do the same for folders, but by using chmod -R 600 /PATH/TO/FILE
so the contents of the folder is the same as well. You should be able to run this on all the folders not owned by ristekga
to stop them accessing them.
If they are owned by ristekga
, running chown -R USERNAME:GROUP /PATH/TO/FOLDER
(or chown USERNAME:GROUP /PATH/TO/FILE
) should work - where USERNAME
is the name of the new owner, and GROUP
is the name of the group the folder it is to part of - but this can usually be the same as the USERNAME
.

- 30,194
- 17
- 108
- 164
chmod
,chgrp
, andchown
. =) By default the user should usually should only have access to his home directory, so what is the problem exactly? – Wilf Dec 02 '13 at 17:26