LinuxQuestions.org
Help answer threads with 0 replies.
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 03-01-2006, 07:30 AM   #1
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Rep: Reputation: 30
Question Login into a dir diff than home


I have just created an account for the webadmin on my box and his home is:

/home/webroot/

however, I would like it that when they login the defulat dir be:

/var/www/htdocs/

obviously i didnt make that the users home else all the settings would be published in the webfolder

is there a way todo this?

~Brian
 
Old 03-01-2006, 07:47 AM   #2
aminmohan
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
to change the default home dir of the user
use usermod -d /var/www/htdocs webroot

else for the new user use adduser -d <dir_name> <user>
 
Old 03-01-2006, 07:48 AM   #3
aminmohan
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
to change the default home dir of the user
use usermod -d /var/www/htdocs webroot

else for the new user use adduser -d <dir_name> <user>
 
Old 03-01-2006, 12:44 PM   #4
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
nice! thank ya much
 
Old 03-01-2006, 12:49 PM   #5
mbreith
Member
 
Registered: Feb 2006
Location: oregon
Distribution: PIII fedora2 | P4 fedora2 | Thinkpad fedora2
Posts: 54

Rep: Reputation: 15
Would doing this make all the config files and default file storage redirect to the /var/www/htdocs/ directory?

would adding a cd /var/www/htdocs/ in one of the user login scripts work better?
 
Old 03-01-2006, 01:28 PM   #6
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
i dont think it does (per my question)... it just tells what its default directory is, not its home directory... by default, a users default dir is its home dir
 
Old 03-01-2006, 02:27 PM   #7
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
The user's default directory is their home directory. The usermod -d command changes the user's home directory entry in the /etc/passwd file. Doing things in the order that you have (create the user and then change the home directory) should still have the desired effect though, because all of the settings are in their old home directory. Any new config files that get created will be put in the new home directory.

If you do ever want to move the contents of the old home directory use the -m switch to usermod as well as the -d switch.
 
Old 07-21-2006, 09:10 PM   #8
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
i just tried the -m switch and got /<folder name> already exists
 
Old 07-21-2006, 09:11 PM   #9
scrupul0us
Member
 
Registered: Jan 2006
Location: Albany, NY
Distribution: CentOS 6.3
Posts: 159

Original Poster
Rep: Reputation: 30
usermod -d /root -m root
usermod: directory /root exists

i just wanted to move root back to its rightful dir... i had it set to another for the longest time and would like to move it back
 
  


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
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
how to share /home between diff distros? letdoit Linux - Newbie 2 05-20-2004 07:30 AM
win98after login on SAMBA server destroyed the HOME dir ShurV Linux - Networking 0 11-02-2003 07:48 PM
home dir vsftpd ilengna Linux - Networking 7 10-14-2003 07:58 PM
nis client login - user home dir not fnd synfield Linux - Networking 0 03-27-2003 03:51 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration