Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2014-01-16
4
Medium Priority
?
1,982 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

610 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