D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Separate Home Partition

 

On 07/09/13 18:02, Gordon Henderson wrote:
On Sat, 7 Sep 2013, Tom wrote:

To change UID and GID the hard way:
find /home -mount -user UID -exec chown newuser {} \;
find /home -mount -group GID -exec chgrp newgroup {} \;

 From the more than one way to do it department:

you could use find ... -print0 | xargs -0 ... here...

(Although the 0 options are probably superfluous as you typically don't
have usernames with spaces in)

Or, if directory names in /home correspond to the usernnames in
/etc/passwd and group names in /etc/group, (fairly typical these days)
then:

cd /home
foreach f (*)
   chown -R $f.$f $f
end

Or if you want it in bash, then:

for f in *; do chown -R $f.$f $f ; done

Gordon

I have looked hard and long at all the replies and I think that I will leave it as it is now, without a separate home partition. And, having read what has been said about having a home on its own partition I think I will not bother to do that in future.

Many thanks

Neil


--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq