How To Change File and Directory Permissions

Sometimes when we upload files via FTP software or install mods or plugins via a forum or blog, etc. the directory and file ownership and/or permissions can get screwed up and cause problems. Here's an quick and easy way to fix this! Just run the following commands in your SSH client. Just make sure you change to the parent directory that you wish the changes to occur using the " cd " command then type one or more of the following to suit your needs. Note that changing permissions is called " chmod " and changing ownership is called " chown ":


For directories and their subdirectories. Please note that you can change " 0755 " to suit your needs:

  • sudo find . -type d -print0 | xargs -0 chmod 0755


For files within a directory or directories. Please note that you can change " 0644 " to suit your needs:

  • sudo find . -type f -print0 | xargs -0 chmod 0644


This will change ownership of ALL directories and files within the specified ' directory ". Note that the " -R " option makes this possible:

  • sudo chown -R username:usergroup /path/to/directory


To change the directory itself but not the directories and files within it, just use the following:

  • sudo chown username:usergroup /path/to/directory





  • SSH, security, VPS
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Accessing Your Files

There are a number of ways to access and edit your files. The most obvious is using FTP. But for...

How to secure SSH - Part 1

In Part 1, we'll be discussing various ways to secure your SSH terminal. Before attempting any of...

Useful CLI Commands

echo $SHELL: Tells you what shell you are in. Yes, there are different types of shells but bash...

Restarting The SSH Service

After using certain SSH commands you may wish or need to restart the SSH daemon (sshd) to make...

Free SSH Clients

Here are some free SSH clients to use on your VPS:   1.  Putty - the original SSH client and...