Have you tried executing the command ls -l on the folder tou want to read/write on? The user you connect with might not have enough rights. This is usually the case when another user has created the files you want to access.
While ls -l lets you check who is the owner of the file/directory you want to access, to change permissions you can use chmod
(more info here)
EDIT:
If you want to manage the access right to a specific folder for a single user, you will have to either:
- Create the folder so that the user is the owner, and thus has all rights on it
- Make sure the owner of the folder allowed the user to access it
To do that, you could for instance change the ownership of the folder and atribute it to the user. That way, you could manage access rights the way you want.
Juste type in sudo chown -R user /var/www/site1
. This recursivelly (thanks to -R) attributes ownership to user.
For a bonus, you could chmod 500 /var/www/site1
so that no-one except user (and root, obviously) could read/write on the folder
NB:
The 5 used as an argument for chmod means you grant read & write permission. To grant read, write & execute permission, use 7. To grant none use 0.
The first number represent the permission for the owner, the second number represent the permission for the group, and the third represent the permission for the other users. Refer to the link provided if you need more info
NB2:
To check your ownership/permission on a file or a folder, type ls -l /my/folder
, and you should get something like this :
-rw-r--r-- 1 root root 65 Feb 11 15:08 index.html
| | |
permissions | |
owner group