LinuxQuestions.org
Review your favorite Linux distribution.
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 05-08-2017, 02:01 AM   #1
kchaitan2
LQ Newbie
 
Registered: May 2017
Posts: 2

Rep: Reputation: Disabled
Creating a new user with other existing home directory is it possible?


Creating a new user with other user existing home directory is it possible?
 
Old 05-08-2017, 02:04 AM   #2
notKlaatu
Senior Member
 
Registered: Sep 2010
Location: Lawrence, New Zealand
Distribution: Slackware
Posts: 1,077

Rep: Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733Reputation: 733
If I understand your question correctly, you want to create a new user, but you want to use an existing home directory.

Assuming you want to create user foo but use /home/bar as home directory:

Code:
# useradd --no-create-home --home-dir /home/bar foo
Done.

You may have to adjust the permissions for /home/bar accordingly.
 
1 members found this post helpful.
Old 05-08-2017, 02:28 AM   #3
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 6,109
Blog Entries: 1

Rep: Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135Reputation: 2135
You provide very little information. It would be nice to know your goal(s).

I suppose what you may be asking is if the new user can be configured to use the homedir of an existing user. I would not attempt to do it, but I submit a heavily qualified yes to what I believe the question to be. The qualifications are that some special configuration would be required, and that these special configurations might not be respected by some applications, leading to especially to write failures, but also to occasional read failures, after switching between users. Both users would have to share the same default group, and directory and file permissions would need to include group rw where normally they would only be read or none. Default umask of 022 would need to be changed to 002 for both. ACLs would most likely need custom configuration too.

If what you want only amounts to a switch, meaning discontinuing use of the original user, and creating a new user to use the homedir of the old user, then, yes, with reduced qualifications. Easier would probably be to change the login name and password on the original account.
 
Old 05-08-2017, 02:51 AM   #4
kchaitan2
LQ Newbie
 
Registered: May 2017
Posts: 2

Original Poster
Rep: Reputation: Disabled
Smile Thanks!

Hi Mr Mazda,

Thanks for quick response and from next time ill provide complete information about the Thread.
 
  


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
Creating user with permission to existing directory? postcd Linux - General 13 03-31-2015 03:38 PM
LDAP - not creating user home directory robertkwild CentOS 8 02-17-2015 05:26 AM
create user without creating user home directory aksharb Linux - Software 1 05-12-2011 04:21 PM
[SOLVED] rename an existing user and his home directory cccc Debian 5 10-29-2009 11:05 AM
Creating a user without a home directory. deedawn Linux - Newbie 2 10-29-2008 11:36 AM

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

All times are GMT -5. The time now is 08:19 PM.

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