View previous topic :: View next topic |
Author |
Message |
J3$U$H1M$3LF n00b
Joined: 22 Nov 2002 Posts: 20 Location: belgium
|
Posted: Wed Nov 27, 2002 10:37 pm Post subject: make EXACT copy of a user including all config files |
|
|
Hi there dudes.
First of all, I'm new to linux, it's like my 4th day or so.
Basicly I have 3 users on my gentoo, lets's say "root" "user1" and "user2".
I first logged on with "user1" and made a lot of changes in configfiles (xchat, fluxbox, ftpcube, ...) and that was a lot of work for a noob like me. Now I want to user the "user2" account but don't feel like redoing that stuff (used "user1" in the first place because a friend helped me out a little, but it's HIS login). So I would like to know how i can get "user2" to have EXACTLY the same configuration as "user1", including the group thing (wheel and other stuff i don't understand 100%).
Is there a way of doing this?
i tried something like this:
Code: | cp -f -r /home/user1/*/ /home/user2/ |
-f because i tought it would help getting all files
-r to get all the subfolders
--> didnt include the configfiles (.files as i think)
i think i found the "su" problem, added "user2" in /etc/group in the "wheel" thing, but don't know anything else about groups, don't get me wrong
I hope someone knows what i mean, would help me a lot...
thanks in advance,
jesus |
|
Back to top |
|
|
chatgris Guru
Joined: 14 Oct 2002 Posts: 383 Location: Canada
|
Posted: Wed Nov 27, 2002 11:07 pm Post subject: |
|
|
I'm a linux newbie too but this might help..
For me, cp does not copy any files that start with a .
To get around this, try.
cp -r /home/user1 /home/user2
that should replace your user2 directory with an exact replica of the user1 directory including all files prefixed with a .
Josh |
|
Back to top |
|
|
J3$U$H1M$3LF n00b
Joined: 22 Nov 2002 Posts: 20 Location: belgium
|
Posted: Wed Nov 27, 2002 11:46 pm Post subject: |
|
|
hmm...
thx a lot, that's a start. Now all the user stuff about the groups, it realy has to be an exact copy except for the username... |
|
Back to top |
|
|
aja l33t
Joined: 26 Aug 2002 Posts: 705 Location: Edmonton, Canada
|
Posted: Wed Nov 27, 2002 11:51 pm Post subject: |
|
|
(1) You need to make sure that user2's home directory is owned by user2 (you can change ownership with the chown command - there is a recursive flag (I think -R) to change the ownership of contained files and directories).
(2) To make user2 a member of the same groups as user1, the easiest way (unless you have a huge number of groups) is to manualy edit the /etc/groups file - wherever you see 'user1', append 'user2'. [This might also be a fun practice problem for sed scripting ... ] |
|
Back to top |
|
|
J3$U$H1M$3LF n00b
Joined: 22 Nov 2002 Posts: 20 Location: belgium
|
Posted: Thu Nov 28, 2002 12:12 am Post subject: |
|
|
thx a lot, you kinda solved the problem
and the file is good to config manualy, only addes myself to "wheel"...
but maybe that's not enough? (since "user1" is only in "wheel", but maybe "user1" is not configged too good either :/)
but a HUGE thanks dude,
love this community |
|
Back to top |
|
|
tomte Tux's lil' helper
Joined: 08 May 2002 Posts: 122
|
Posted: Thu Nov 28, 2002 12:26 am Post subject: |
|
|
J3$U$H1M$3LF wrote: | hmm...
thx a lot, that's a start. Now all the user stuff about the groups, it realy has to be an exact copy except for the username... |
Warning: Spoiler
this will take all the fun of discovering it all by yourself...
as root:
stuff you allready did, but maybe wrong:
Code: |
cd /home
cp -R user1 user2
chown -R user2.users user2/
|
notice: the uppercase -R as cp option, consult the man-page for an explanation and why you shouldn't use -r with gnu cp
group-change:
Code: |
allgroups=`groups user1`
allgroups=`echo $allgroups | sed 's/ /,/g'`
usermod -G $allgroups user2
|
notice: backticks are great
alternate spelling of some commands:
Code: |
allgroups=$( groups user1 )
allgroups=$( echo $allgroups | sed 's/ /,/g' )
|
bash rulez ok
and as a last note if your're using kde:
some files under ~/.kde/ are symlinks to pipes under /tmp, you should remove these, they will be created during the next login.
hth,
tomte |
|
Back to top |
|
|
J3$U$H1M$3LF n00b
Joined: 22 Nov 2002 Posts: 20 Location: belgium
|
Posted: Fri Nov 29, 2002 9:06 am Post subject: |
|
|
thx a lot guys, everyone who helped on this topic...
I'm not running KDE though, kinda in love with fluxbox
ps: i copied all files and used chown and stuff and it all works great |
|
Back to top |
|
|
|