?
Solved

how to create user and assign home directoy to the existing directory

Posted on 2014-01-16
4
Medium Priority
?
1,891 Views
Last Modified: 2014-02-08
Dear Experts:

I am having redhat enterprise linux 6 working as crm server the implementer have created the directory /var/www/html/crm

now iam interested to create the user named crm and the home directory of the user crm should be /var/www/html/crm.

can you please suggest on how to do this, this is production server.

Thanks in advance.
0
Comment
Question by:D_wathi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 1000 total points
ID: 39784841
As root:

useradd -d /var/www/html/crm crm

passwd crm


The above uses the defaults except for the home directory. Run

useradd -D

to see these defaults.
0
 

Author Comment

by:D_wathi
ID: 39784954
thank you very much, did test with the below

tried the below

useradd -g tom4 -G apache,ws15 -d /var/www/html/tom4 tom4
useradd: warning: the home directory already exists.
Not copying any file from skel directory into it.

think since the directory tom4 was already there hence the above warning can be ignored or should it be manually copy files from /etc/skel please suggest
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 39784978
This depends on whether you need shell initialization files (.profile, .bashrc) for the new user.

I think your CRM implementer will have their own profiles to use for the application users, but if this is not the case you can simply copy .profile and/or .bashrc from /etc/skel.
Don't forget to change the ownership to the new user/group after copying!

Both files do not contain important things yet, they're meant to be customized by you anyway.
".profile" sources "/etc/profile" if it hasn't already been called, so this might be worth to be considered.

Another possible (but not at all mandatory) initialization file is .exrc (for vi), which might be useful.
0
 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 1000 total points
ID: 39788110
Simple way is create the user and then modify /etc/passwd with correct home directory for this user and yes you need to modify directory permissions accordingly in case you are not allowed to change user/group owner then enable acl and add this user as owner with required permissions.

TY/SA
0

Featured Post

Video: Liquid Web Managed WordPress Comparisons

If you run run a WordPress, you understand the potential headaches you may face when updating your plugins and themes. Do you choose to update on the fly and risk taking down your site; or do you set up a staging, keep it in sync with your live site and use that to test updates?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question