Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to use chgrp or chown to change a file's group to one that I as the owner am not a part of? I own the file, but I am not part of the group that I want to change it to, so can it be done without using sudo?

share|improve this question
    
No you need to be either in that group or you should be admin. –  raaz Feb 24 '13 at 3:26
    
Though technically correct what @mordoc posted I see 1 loophole in your question that allows you to do this. –  Rinzwind Feb 24 '13 at 6:37
add comment

2 Answers

Unfortunately you need to be a member of that group to give that group permission as per this link:

http://serverfault.com/questions/462174/using-chown-to-change-the-group-owner-of-a-directory-is-not-permitted-why

sudo is your only option...

share|improve this answer
add comment

Yes, you can. As long as you have physical access to a machine you do not need sudo.

  • Reboot.
  • Enter grub rescue mode. To do so, when GRUB is presenting the menu list (you might need to press ESC to show the menu while booting), follow those instructions:

    • Use the arrows to select the boot entry you want to modify.
    • Press e to edit the entry
    • Use the arrows to go to kernel line
    • Press e to edit this entry
    • At the end of the line add the word single
    • Press ESC to go back to the parent menu
    • Press b to boot this kernel

You will get a root prompt and can use chmod, chown and chgrp without sudo or being part of that file's group.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.