LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-18-2014, 04:07 PM   #16
Jay88
Member
 
Registered: May 2009
Location: London
Distribution: Xubuntu 14.04
Posts: 49

Original Poster
Rep: Reputation: 15

Quote:
Originally Posted by Jay88 View Post
how can I change the ownership of all files and directories in my home folder to my username?
Ignore my question - I used chown jay:jay /home/jay/.* and it worked

I can now log in and out of the desktop with no problems or error messages and my all of my files on in my /home partition are loaded. Thanks for all of your help.

Jay
 
Old 12-19-2014, 02:15 AM   #17
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Chown is the tool I would use as it can do a lot of files, complete directories, at once.
Code:
# chown -R 1000:1000 /<directory path>
Will recursively (-R) change the user owner to 1000 and the user group owner to 1000 for the directory defined.

So;
Code:
chown -R 1000:1000 /home/<your user name>
Would set all permissions in your home directory to you and your group.

I do this on installs such as this one that shares a /home partition with another install. As they are installed separately both primary users, with different names to avoid ~/.foo file conflicts, are designated as user 1000.

Running that command changes the files in my testing install from tom:tom ownership to 1000:1000 there. Running the same command in my sid install does the same thing for my sam:sam permissions.

So sam can open the /home/tom directory from here in Sid and own the files. When I log in to testing then tom can do the same in /home/sam.

In your case you could use your user name in place of 1000 if you want. I prefer the numeric id.
 
Old 12-19-2014, 05:22 AM   #18
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Well I am glad it works.

Feels good when things work out.
 
Old 12-20-2014, 12:14 AM   #19
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Quote:
Originally Posted by widget View Post
Chown is the tool I would use as it can do a lot of files, complete directories, at once.
Code:
# chown -R 1000:1000 /<directory path>
Will recursively (-R) change the user owner to 1000 and the user group owner to 1000 for the directory defined.
I'm pretty sure you're aware of this, but for the benefit of newcomers who may not know it I'm adding this reply. The UID for non-system users does NOT always start at 1000, although it does for all *buntu flavors and I believe for Debian as well.

However, Red Hat derived systems usually start the range at 500. I ran into this when copying files from my previous Mandriva installation over to my first Xubuntu system back in 2007.

And of course, internally all the file systems track ownership by the UID, not the name itself, which can be quite mystifying until one knows what is happening.
 
1 members found this post helpful.
Old 12-20-2014, 09:50 PM   #20
widget
Senior Member
 
Registered: Oct 2008
Location: S.E. Montana
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628

Rep: Reputation: 497Reputation: 497Reputation: 497Reputation: 497Reputation: 497
Quote:
Originally Posted by JimKyle View Post
I'm pretty sure you're aware of this, but for the benefit of newcomers who may not know it I'm adding this reply. The UID for non-system users does NOT always start at 1000, although it does for all *buntu flavors and I believe for Debian as well.

However, Red Hat derived systems usually start the range at 500. I ran into this when copying files from my previous Mandriva installation over to my first Xubuntu system back in 2007.

And of course, internally all the file systems track ownership by the UID, not the name itself, which can be quite mystifying until one knows what is happening.
Exelent point.

All Debian branch distros use 1000.

All RH based systems, including the ones from the Mandrake fork use 500.

I am not sure about Suse but assume it too uses 500.
 
2 members found this post helpful.
Old 12-22-2014, 08:14 AM   #21
Jay88
Member
 
Registered: May 2009
Location: London
Distribution: Xubuntu 14.04
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by JimKyle View Post
I'm pretty sure you're aware of this, but for the benefit of newcomers who may not know it I'm adding this reply. The UID for non-system users does NOT always start at 1000, although it does for all *buntu flavors and I believe for Debian as well.

However, Red Hat derived systems usually start the range at 500. I ran into this when copying files from my previous Mandriva installation over to my first Xubuntu system back in 2007.

And of course, internally all the file systems track ownership by the UID, not the name itself, which can be quite mystifying until one knows what is happening.
This is why the UID for my home folder was set to 500 - I used to run Fedora, and this was the cause of the whole problem. So by changing the ownership of all files and folders on my home partition to my username instead of the user ID - 1000, I should be able to avoid the problem in future if I ever decide to install a new distro and use the same home partition just as long as I use the same username.
 
Old 12-22-2014, 09:24 AM   #22
JimKyle
Member
 
Registered: Dec 2001
Location: Oklahoma City, OK, USA
Distribution: Xubuntu 16.04 LTS
Posts: 214
Blog Entries: 1

Rep: Reputation: 39
Should NOT work just fine!

OUCH!!! Re-reading this in the morning I see that I didn't get your meaning last night and consequently gave you a totally wrong response.

It won't work in every case, because the files themselves don't have your name, just the UID. It will work if, and only if, your new OS uses the same UID for your name!

Specifically, the ownership is stored in the first inode of the file, as a binary number. This allows it to always occupy the same number of bytes regardless of the number of characters in the owner's name. You don't have to know these details to use the system, but they sometimes help in understanding what's going on in the background.

Last edited by JimKyle; 12-23-2014 at 10:12 AM. Reason: To correct a totally inaccurate original response.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Show apps from all workspaces on the desktop panel - Xubuntu XFCE 4.10 jagibbs Ubuntu 1 02-07-2013 09:31 PM
Desktop icons and panel vanish if I change resolution. Got 14.1 MATE ScottDC Linux Mint 2 12-25-2012 09:53 PM
Desktop icons and panel vanish if I change resolution. ScottDC Linux - Laptop and Netbook 1 12-21-2012 11:26 AM
gnome launcher icons - why different choices if on Desktop or Panel??? taylorkh Linux - Newbie 4 12-20-2009 07:59 AM
Bring up icons + top panel to desktop very slowly? quanta Fedora 1 03-31-2008 04:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration