Solved

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

Posted on 2014-01-16
4
1,825 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 250 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 250 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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

​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…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

691 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