LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 07-24-2009, 06:25 PM   #1
Sanderlin
LQ Newbie
 
Registered: Jun 2009
Location: Arkansas
Posts: 3

Rep: Reputation: 0
Fedora 10, accidently created a user with the same home directory, is there any hope?


In a very long story short, today I fixed a customer's issues by redirecting their server log in so it authenticated correctly... Well, instead of calling me for an answer, he thought he'd just save the company some money and created a new user, in hopes of bypassing what I had just done.
For those confused, I created a launcher that repointed our samba network from smb://server/storage to smb://<user>@server/storage. This fixed the other issue they had with the files not working with their windows machines, but this is not a windows issue.
Furthermore, in creating the new user, he happened to create it in the same home directory as the first. The problem being we renamed how the 1st account appeared but didn't change the home directory, that worked fine, but he didn't realize this, hence the 2 users, 1 directory issue... My question is this: Is there any way to save all the items from the home directory, or is it a lost cause? He has his whole VMware settings, which took him a long time to set up, a couple of files, and some other things in that file that we would love to recover so we don't have to recreate the wheel.
Any help would be greatly appreciated. We have a windows xp pro disk standing by just in case, but we'd rather not go that route, even though the whole rest of the office is windows except the server.

Thank you,
 
Old 07-24-2009, 07:34 PM   #2
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
I'm not sure I understand the problem.

Do you have user1 and user2, each with different user IDs? And is there now one home directory for the two users?

Can't you just clone the directory? Something like this (as root), if user1 owns it?
Code:
cp -pr /home/user1 home/user2
chown -R user2 /home/user2
usermod -d /home/user2 user2
And then each user deletes the the other's stuff from his directory?
 
Old 07-26-2009, 06:57 PM   #3
Sanderlin
LQ Newbie
 
Registered: Jun 2009
Location: Arkansas
Posts: 3

Original Poster
Rep: Reputation: 0
Exactly the problem!

Quote:
Originally Posted by KenJackson View Post
I'm not sure I understand the problem.

Do you have user1 and user2, each with different user IDs? And is there now one home directory for the two users?

Can't you just clone the directory? Something like this (as root), if user1 owns it?
Code:
cp -pr /home/user1 home/user2
chown -R user2 /home/user2
usermod -d /home/user2 user2
And then each user deletes the the other's stuff from his directory?
Actually, Yes! that's exactly it! I HAD 2 users with different IDs and only one single root. So, I went throught the command line and created user 3 so i could actually access the machine to confirm my suspicions of what had happened. Sure enough user 1 and 2 had the same home directory... Like I said, I was not the one who made the users as they were trying to save their company money. I have tried using
Code:
 chown -r user1 /home/user2
as well as
Code:
chown -r user1 /home/user2
I'm trying to set everything back to the original user, I went through and changed the home directory of user2 to no file then deleted it, therefore preserving the "shared" home directory. I use the term "shared" because they both used the same directory and not because it was actually shared.

Also, while doing the chown, as root, I ran into an interesting error stating it could not preform the action, any ideas?

Thank you for your help,
 
Old 07-26-2009, 09:12 PM   #4
KenJackson
Member
 
Registered: Jul 2006
Location: Maryland, USA
Distribution: Fedora and others
Posts: 757

Rep: Reputation: 145Reputation: 145
Quote:
Originally Posted by Sanderlin View Post
Also, while doing the chown, as root, I ran into an interesting error stating it could not preform the action, any ideas?
That depends what the error message says.

But if you were trying to operate on a directory while that directory was the current directory, you may get an error. Try to cd out of the directory and try again (if applicable).

If you started an application, such as emacs, while that directory was current, the application probably still sees it as current, so you might have to close the application first.
 
Old 07-27-2009, 11:54 AM   #5
Sanderlin
LQ Newbie
 
Registered: Jun 2009
Location: Arkansas
Posts: 3

Original Poster
Rep: Reputation: 0
Well, I was doing the changes as root rather then a user. I believe the message was "operation not permitted" which is what confused me. I'm getting into it by pressing "esc" while it boots up, choosing the version to boot into, then hitting "a." then I log in as root and proceed with the commands. I hate to say it, but I've got one other thing I thought of to try, if that doesn't work, they have requested I put windows xp back on it. Thank you very much for your help Ken, but I will be sure to let you know what happens if I figure it out.

Thank you very much,
Tony H.
 
  


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
files are created in my /home directory sycamorex Linux - Security 3 08-02-2008 04:19 PM
useradd - No home directory is created ]SK[ Linux - Newbie 16 07-14-2008 01:35 PM
Defining home directory of a newly created user?? ggarrette Linux - Newbie 4 07-01-2008 02:47 PM
Emergency : accidently deleted my user directory Vassos Linux - Newbie 4 11-20-2007 05:33 PM
Created new home directory and lost my files jnewby72 Linux - General 4 01-25-2006 11:25 PM

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

All times are GMT -5. The time now is 04:53 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