Ask Your Question
1

Usermod or passwd for UID change <=F16

asked 2011-11-21 11:01:18 -0500

Frankly3D gravatar image

usermod -u "user" doesn't seem to do anything else. If I change /etc/passwd. 1000:1000 chown -R /home/user I'm left with a lot of .hidden files that give me no permission. and stuff won't start thunar etc.

I just don't want to reinstall every box as it hist F16. Have F14/15/16/Rawhide real and vm.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2011-11-21 12:06:15 -0500

FranciscoD_ gravatar image

To change perms of the hidden files, may be you could try a hack like so (as root):

$ find ~user/ -name ".*" -type d -exec chown -R user:group '{}' \;

I've seen that find works on hidden dirs, so this might just work.

edit flag offensive delete link more
0

answered 2011-11-23 11:03:33 -0500

Peter Scott gravatar image

updated 2011-11-23 14:03:51 -0500

I'd use find too but there are typos in FranciscoD's answer.

It should start with:

find -user OLD_USER_NUMBER -name ".*" -type d

Also, xargs is a more generally useful tool than find's -exec option so I'd use:

find -user OLD_USER_NUMBER -name ".*" -type d | xargs -I {} chown -R USER:GROUP '{}'

Thanks to FranciscoD for pointing out that find will have to be given the old, numeric user ID (OLD USER NUMBER) and not the new USER

edit flag offensive delete link more

Comments

by ~user I meant ~ankur = /home/ankur, not the -user option ;)

FranciscoD_ gravatar imageFranciscoD_ ( 2011-11-23 12:31:14 -0500 )edit

Erm, I just noticed: Wouldn't using -user not work? Since his files have wrong ownerships and permissions?

FranciscoD_ gravatar imageFranciscoD_ ( 2011-11-23 12:32:27 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2011-11-21 11:01:18 -0500

Seen: 954 times

Last updated: Nov 23 '11