Linux : Change file/folder owner

On a Unix based system, all files and folders belong to a group and a owner. Or rather, an owner and a group has specific permissions to read, write and execute files. So you might need to change the owner of certain files and folders so that you’ll be able to open them, edit them and write to them again.

I’ll show you how to do this via SSH. You’ll need a login and password in order to access the shell.

ssh -lroot

Once logged in, change the directory to the one where the files/folders are located.

cd /var/www/vhosts/

Then you might want to recursively change the owner for all files and folders inside that directory to another user. Lets set the owner of the files and folders to “peter”

chown -R peter *

That is all there is to it. You have just changed the owner of all files and folders recursively inside the specified directory to “peter”. You can now open the files (for example via FTP), edit them and write back to them again. Good luck!


  1. By avatar

  2. By Ivan

  3. By Les

  4. By Eduardo

  5. By Pawan

  6. By quimkaos

  7. By ligrex

Leave a Reply

Your email address will not be published. Required fields are marked *

Pin It on Pinterest

Share This
Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

%d bloggers like this: