1and1 Help Centre Categories

print article

Change File Permissions via SSH

For Linux packages with SSH access

Learn how to manage file permissions on your 1&1 WebHosting Linux package using SSH.

To change the file permissions, please follow the step-by-step instructions provided below.

Step 1
Connect to your Webspace via SSH.
Step 2
Use the 1 command to list the files of the current folder in long format. This will display file permissions as seen below:
(uiserver):u12345678:~ > l

-rw-r--r--  1 u12345678 ftpusers      253 Apr 5 2011 php.ini

Starting on the left are the file access permissions, followed by the number of files in question (ignored in this example) followed by the owner and the group assigned to the file or directory.

The file access permissions will either contain a dash (-) or a letter. The first space will contain a d if the line item is a directory folder. The remaining 9 spaces represent whether the file/folder has read, write and execute permissions for the user/ group.

Directory User Permissions Group Permissions Others' permissions User Group
d rwx r-x r-- u12345678 ftpusers

In the example above, the item listed is a directory signified by the d at the very beginning of the line. If the item were a file instead, there would be - in place of the d.

The user permissions mean that the user (u12345678) can read, write and execute the directory, signified by the rwx letters.

The group permissions mean that anyone in the ftpusers group can read and execute the directory but cannot write to it, signified by the r-x letters.

The others' permissions mean that anyone that is not the user and not in the group ftpusers, is only allowed to read the directory. This is signified by the r-- letter.
Step 3
You can change the permissions of a file if you like. Additional FTP users created through the 1&1 Control Panel will use the same ftpusers group, so group permissions mirror user permissions.

To allow certain rights for users to a webpage named index.html, enter the chmod o+r index.html command to change modes for others by adding read permissions.
The chmod u+r index.html command will add read permissions for the user, while chmod g-w index.html will remove write access for the group assigned to index.html.
For additional information, you may want to reference: