Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Nejc Vukovic
Nejc Vukovic
Full Stack JavaScript Techdegree Student 38,885 Points


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