Search code examples
windowscommand-line-interfacefile-permissions

Unable to change permissions, after cloning and adding new files


drwxrwxr-x 2 rynostajcar-130991 rynostajcar-130991 4.0K Feb 20 16:13 .
drwxrwxr-x 4 rynostajcar-130991 rynostajcar-130991 4.0K Feb 20 16:13 ..
-rwxrwxr-x 1 rynostajcar-130991 rynostajcar-130991  347 Feb 20 16:13 console
-rw-r--r-- 1 root               root                 47 Feb 20 16:17 schedule
-rwxrwxr-x 1 rynostajcar-130991 rynostajcar-130991  131 Feb 20 16:13 setup
[16:33:12] (master) bin
// ♥ whoami
rynostajcar-130991

I recently cloned a repository I made this morning onto another computer and added a new file 'schedule'. I noticed now im unable to change permissions of that file, I assume its due to the file being root. Im still new so could someone explain how to change the user from root to rynostajcar?


Solution

  • After looking around I found out my problem was the user, I can not change the file permissions while the user is root. I used sudo chown rynostajcar-130991:rynostajcar-130991 ./schedule which allowed me to switch the user from root to rynostajcar-130991 and change the permissions of my file schedule. Im still having problems with the new file user always being root so working on how to fix that next.