PDA

View Full Version : [ubuntu] Permission Problems



SoulMazer
June 16th, 2009, 11:26 PM
Just today I created a new partition on my hard drive and did a fresh install of Ubuntu on it. I simply mounted my old Ubuntu file system and copied the entire home directory to my new home directory (this required sudo). Yet, I tried to open a text file and save it, and it said I did not have permission to do so. I am guessing this is because the owner is "root". How can I recursively set the owner of all these files/directories to my current user?

Thanks in advance for any help.

theozzlives
June 16th, 2009, 11:29 PM
sudo chown user:group /home/user -RNOTE: that is a capital R

SoulMazer
June 16th, 2009, 11:32 PM
Exactly what I needed. The -R at the end was messing me up.

Thanks.

lavinog
June 16th, 2009, 11:33 PM
The terminal is usually the easiest way:

sudo chown -R username path

the graphical way would be to start nautilus as root:
alt-f2:
gksudo nautilus
then right-click the folder you need to change the owner of.
select properties
then permissions (tab)
change the owner
click on Apply permissions to enclosed files
close the properties window and close nautilus (so you don't continue to use it and accidently do something you don't want to)

chrisgaffrey
June 19th, 2009, 04:53 PM
The terminal is usually the easiest way:

sudo chown -R username path


Lavinog, thank you kindly for this. I was having a similar issue with permissions and needed to find out how to change them.

So as to not have any problems in the future, I gave my self ownership of the entire filesystem, by running:


sudo chown -R username /

And the problem was solved.

However, I wanted to ask, is there any reason why having a user as the owner of the entire filesystem might cause problems? Thanks in advance.

Edit: Do not do run
sudo chown -R username / it screws up your system.

lavinog
June 19th, 2009, 07:50 PM
Lavinog, thank you kindly for this. I was having a similar issue with permissions and needed to find out how to change them.

So as to not have any problems in the future, I gave my self ownership of the entire filesystem, by running:


sudo chown -R username /

And the problem was solved.

However, I wanted to ask, is there any reason why having a user as the owner of the entire filesystem might cause problems? Thanks in advance.

There is a huge security issue for one.
That command you show, changes the ownership of the entire system. I have never used it, but I would think that it should at least give you some error messages.
By changing the ownership of everything you effectively removed the requirement for sudo for any system changes, and removed a major security barrier that protects your system from malicious activities.

Restoring this might not be very trivial.
I think you should chown the following to root:
/etc
/bin
/usr
/lib

Personally I think you may want to consider a reinstall.

BandD
June 19th, 2009, 07:54 PM
there is a huge security issue for one.
That command you show, changes the ownership of the entire system. I have never used it, but i would think that it should at least give you some error messages.
By changing the ownership of everything you effectively removed the requirement for sudo for any system changes, and removed a major security barrier that protects your system from malicious activities.

Restoring this might not be very trivial.
I think you should chown the following to root:
/etc
/bin
/usr
/lib

personally i think you may want to consider a reinstall.

+1

chrisgaffrey
June 20th, 2009, 12:27 AM
There is a huge security issue for one.
That command you show, changes the ownership of the entire system. I have never used it, but I would think that it should at least give you some error messages.
By changing the ownership of everything you effectively removed the requirement for sudo for any system changes, and removed a major security barrier that protects your system from malicious activities.

Restoring this might not be very trivial.
I think you should chown the following to root:
/etc
/bin
/usr
/lib

Personally I think you may want to consider a reinstall.

Yeah, I screwed the pooch on that one. I just got down reinstalling and now have to reconfigure everything. Well there's a noob mistake I hope others will not make.

Gonna go edit my other post so as to warn other not to do that.