Setting the correct file permissions makes your website files and emails more secure. Follow the steps below on how to change the file permission via SSH connection. The sample filename is testvd.html and its current file permission is 755. The goal of this article is to change it to file permission 644.
|Note: SSH connections are only allowed in Vodien Virtual Private Servers and Dedicated Servers .|
Step 2. Enter the code below to enter the directory or to connect to a specific directory. See the line labeled 1 in the image below.
Code = cd + space + forward slash [/] + directory name
As shown on the code above, the directory name in this example is home/public_html/test.
Step 3. Enter the code below to see the list of files in the current directory. See line labeled 2 in the image above.
Step 4. Enter the code to change the file permission. See line labeled 4 in the image above.
Code = chmod + space + new file permission + space + file name
chmod 644 testvd.html
As shown on the code above, the new file permission is 644 and the file to modify is testvd.html.
As shown on lines numbered 3 and 5, the file permissions have changed from 755 to 644. The file permissions are the details inside the box. There are three users on each directory:
Users are separated with dash/es as shown in the box below.
Each permission mode has a corresponding number as follows:
- Read (r) – 4
- Write (w) – 2
- Execute (x) – 1
The permission modes on a user are added if there is more than one. So, the file permission showing in the box above is 644. File permission 644 is the default working permission for website files and 755 for folders.