Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Console Foundations Users and Permissions File Ownership

I can change file ownership even if I´m not the owner

Hi. I noticed while being logged in as treehouse I can change the hello.txt file ownership even when the actual user and group owner is mike, shouldn´t be the owner the only one permitted to change ownership?

I tried to do the same but being logged in as mike and change the hello.txt ownership while the owner was treehouse and I get the error: "mike is not in the sudoers file. This incident will be reported"

2 Answers

Hi.

With linux it's like this: if the user is in the sudoers file then that user has the root powers :)

The file resides in /etc/sudoers.

It doesn't matter when you are the owner of the file. A user with root abilities can change any file as he wishes.

It's how thing work. So if you would add mike to the sudoers file that mike could change the chmod on any file.

Guess he ain't in the sudoers file :)

Great! thanks Nejc