LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2009, 11:29 PM   #1
michalng
Member
 
Registered: Dec 2005
Distribution: Debian KDE / Fluxbox
Posts: 222

Rep: Reputation: 46
Can I copy a user profile to another user?


After install linux and configured a user to what I want (e.g.
Desktop settings, Firefox settings etc.) - how can I copy this entire setup to a newly create user?

Appreciate any advise.
 
Old 02-28-2009, 11:47 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Code:
cp -r /home/user1 /home/user2
chown -R user2 /home/user2
 
Old 03-01-2009, 03:51 AM   #3
kapilbajpai88
Member
 
Registered: Jul 2008
Location: Bangalore, India
Distribution: RHEL
Posts: 235

Rep: Reputation: 41
Cool

Hi michalng,

This is totally depending upon permissions. But only root can assign such permissions to users, and not a user himself.
You can try the above commands as specified by Tinkster, they are really helpful. Else you can study a bit about permissions with usermod and group commands and you will figure out the solution on your own. What i am trying to tell you is that either you copy complete files from a user to other user's directory...Or you can put several users in a single group so that file accessing becomes easier.

Cheers,
Kapil
 
Old 03-10-2009, 11:21 AM   #4
michalng
Member
 
Registered: Dec 2005
Distribution: Debian KDE / Fluxbox
Posts: 222

Original Poster
Rep: Reputation: 46
Quote:
Originally Posted by Tinkster View Post
Code:
cp -r /home/user1 /home/user2
chown -R user2 /home/user2
Seems to be a slight error.

Instead of copying the entire contents of folder of user1 to user2.

the first command actually copies the folder of user1 into user2.


Anyway to tweak the command ?
 
Old 03-10-2009, 12:09 PM   #5
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
that -r should copy everything, the r switch is for recursive copying. Saying that, then, try

Code:
cp /path/to/dir/* /path/to/destination/
chown user /path/of/above/destination
though you'll have to create the dir first.

Why don't you want the whole directory copying? They should both have the same name anyway, shouldn't they? I can't see why they wouldn't
 
Old 03-10-2009, 12:28 PM   #6
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,227

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
you also forgot the second step

it would be
chown user /path/of/above/destination
chgrp user's_grop /path/of/above/destination (the group name is often the same as the user name)
 
Old 03-10-2009, 01:14 PM   #7
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
In that case, do
Code:
chown user:user_group
and save yourself a step
 
Old 03-10-2009, 02:55 PM   #8
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by michalng View Post
Seems to be a slight error.

Instead of copying the entire contents of folder of user1 to user2.

the first command actually copies the folder of user1 into user2.


Anyway to tweak the command ?
Only if you happened to create the dir user2 first ...
in that case cp will stick whatever you wanted to copy
inside the "target directory".
 
Old 03-10-2009, 03:38 PM   #9
SlowCoder
Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Fedora (Desktop), CentOS (Server), Knoppix (Diags)
Posts: 934

Rep: Reputation: 38
On a side note, /etc/skel is a sort of default user profile location. When a new user account is created, the contents of /etc/skel get copied to the new user's /home profile.
 
Old 03-10-2009, 04:53 PM   #10
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,241
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
I agree with Slow Coder, if you want these settings to automatically apply for all new users, as they are created. /etc/skel is what you want to look at.

http://www.linuxhowtos.org/Tips%20an...using_skel.htm
 
Old 03-10-2009, 04:58 PM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677Reputation: 677
You might want to compare the differences between the model you want to use and the /etc/skel/ contents. Maybe you don't want to include everything, such as ~/.mozilla/ or ~/.thumbnails/, but want ~/.kde, ~/.vimrc, ~/.mplayer, etc.
 
Old 04-19-2015, 05:55 AM   #12
mggyi
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Rep: Reputation: Disabled
Copy settings to another user

If you are root-user, open rootfolder and ctrl+h show the hidden files and folders. Then copy .config folder.

In another window open your new-user folder and ctrl+h show the hidden files and folders and you see .config folder too. In this folder paste the .config folder you previsously copied. And click Merge and Replace when it prompts you to choose.

That's it. Log out as root and log in as the user you created.

command line

cp -R --force /root/.config /home/user/.config
 
Old 04-19-2015, 06:02 AM   #13
mggyi
LQ Newbie
 
Registered: Jan 2015
Posts: 3

Rep: Reputation: Disabled
can I copy this entire setup to a newly create user?

Quote:
Originally Posted by michalng View Post
After install linux and configured a user to what I want (e.g.
Desktop settings, Firefox settings etc.) - how can I copy this entire setup to a newly create user?

Appreciate any advise.
If you are root-user, open rootfolder and ctrl+h show the hidden files and folders. Then copy .config folder.

In another window open your new-user folder and ctrl+h show the hidden files and folders and you see .config folder too. In this folder paste the .config folder you previsously copied. And click Merge and Replace when it prompts you to choose.

That's it. Log out as root and log in as the user you created.

command line

cp -R --force /root/.config /home/user/.config
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
system profile vs user profile bonito SUSE / openSUSE 3 06-28-2006 02:02 PM
Load kde profile from /mnt/removable/user instead of /home/user preacher.ca Linux - General 3 12-02-2005 04:00 PM
user profile ust Linux - Software 1 10-04-2005 08:01 AM
transfer user profile bikov_k Linux - Newbie 3 10-22-2004 09:40 PM
user profile nautilus_1987 LQ Suggestions & Feedback 2 09-01-2002 05:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:52 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration