LinuxQuestions.org
Review your favorite Linux distribution.
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-01-2008, 01:08 PM   #1
ggarrette
LQ Newbie
 
Registered: Jun 2008
Posts: 14

Rep: Reputation: 0
Defining home directory of a newly created user??


I'm following directions from:

http://www.howtoforge.com/opennms_network_management

and after creating a user with the useradd command I have to define a home directory of /opt/pgsql/

How do I do this?


Thanks!!
 
Old 07-01-2008, 01:29 PM   #2
Cuetzpallin
Member
 
Registered: Feb 2008
Location: Monterrey, MX
Distribution: Slackware since 3.4 and love it!!!
Posts: 164

Rep: Reputation: 31
adduser command ask to you for the home directory of your new user.
 
Old 07-01-2008, 01:44 PM   #3
ggarrette
LQ Newbie
 
Registered: Jun 2008
Posts: 14

Original Poster
Rep: Reputation: 0
I don't remember there being an opportunity for that...

How do I define a home directory of a user, if not given the opportunity at first?
 
Old 07-01-2008, 02:13 PM   #4
strick1226
Member
 
Registered: Feb 2005
Distribution: Arch, CentOS, Fedora, macOS, SLES, Ubuntu
Posts: 327

Rep: Reputation: 63
Code:
useradd -d custom_home_dir_path username
would link the user and intended home directory at the time of the user account creation...

usermod could help if you don't want to/can't delete and recreate the new user account.

Code:
usermod -d new_home_dir_path existing_username
would change it, I think.


Perhaps one better:

Code:
usermod -d -m new_home_dir_path existing_username
should both change the user home directory assignment _and_ move the current/old home directory contents for the user to the new location.
 
Old 07-01-2008, 02:47 PM   #5
ggarrette
LQ Newbie
 
Registered: Jun 2008
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks!!!!
 
  


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
Can't access newly created directory DaftDave Linux - Newbie 4 06-27-2008 04:00 PM
Newly created File/directory permissions? redrobin77 Fedora 3 11-14-2005 04:55 AM
I can't login with newly created user r_ibsen Linux - Newbie 2 06-19-2004 08:32 AM
Nothing inside X Window for newly created User ID benny Linux - Newbie 6 04-10-2004 12:03 AM
Is there a way to custiomize newly created user profiles? pandersson61 Linux - General 3 01-17-2004 02:12 AM

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

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