How do I change ownership of files and directories from root user to another user on my node?

Introduction

This issue was experienced by many new pool operators who built their nodes using the Guild Operators scripts to build their nodes as a root user on their Linux server. This had the consequence that all their files and folders under the CNODE directory were owned by root and was not usable after the upgrade to CNTools 6.0.3

Parts of this answer is a transcript of Damien Ostrelith's YouTube video (from about minute 5:00) on how to resolve this problem.

Step 1 - Open a terminal session and change to the directory where the Cardano node resides

In CNtools this is under /opt/cardano:

cd /opt/cardano

Step 2 - Perform the chown command on the command line

sudo chown -R node:node cnode/

Remember to replace node with the username you chose or use on your system.

Step 3 - Check to see if the folders and files are now changed to the new username

ls -al

If everything looks fine the change of ownership was successful and complete.



 

This answer was published on 30th January 2021

 

Shortcut URL to this answer:

https://cutt.ly/EktOsMr