LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Changing user's home directory? HOW (https://www.linuxquestions.org/questions/debian-26/changing-users-home-directory-how-262270/)

barton 12-03-2004 04:43 PM

Changing user's home directory? HOW
 
I want to change a user's home account directory:
/home/upload/

to

/var/www?

How do I do this?
I have spent time with google and manuals.
I apologize if this ridiculous question. This must me easily solved in some config file. I just don't know which one.

-mike

Moloko 12-03-2004 04:58 PM

I don't get it, you want to configure Apache in a way so that the upload dir shows up on a webpage? You could change /etc/apache/httpd.conf as well. I hope you don't mean to move an entire home dir of a user?? I don't see why you should want this.

zuralin 12-03-2004 05:22 PM

/etc/passwd

barton 12-03-2004 05:37 PM

Quote:

Originally posted by zuralin
/etc/passwd
Thanks this solved the problem.

"/etc/apache/httpd.conf " - I will look into this aswell. Thanks for the input.

-mike

Moloko 12-04-2004 01:58 PM

What has changing the password to do with moving a home dir?

kboone 12-04-2004 11:48 PM

Entries in the /etc/passwd file specify where the user's home directory is. For example, on my system:
Code:

boone:x:1000:1000:Keith Boone,,,:/home/boone:/bin/bash
Here's a link to the man page for passwd, which explains what the various fields are used for:
http://www.scit.wlv.ac.uk/cgi-bin/mansec?4+passwd

Moloko 12-05-2004 06:04 AM

thx, another enlightenment :)

Frustin 03-31-2005 04:59 AM

is there a command line method without running the risk of ruining the /etc/passwd file?

Deeze 04-01-2005 05:21 PM

Quote:

Originally posted by Frustin
is there a command line method without running the risk of ruining the /etc/passwd file?
Make a backup of the file before you edit it. This simple advice (if they would only follow it) would save many people so much hassle.

thegeekster 04-01-2005 05:47 PM

Quote:

Originally posted by Frustin
is there a command line method without running the risk of ruining the /etc/passwd file?
Run: vipw

This allows safe editing of /etc/passwd and automatically creates a backup (/etc/passwd~) if changes are made.......

NOTE: To change the default editor from vi, make sure you enter an environment variable, called VISUAL and/or EDITOR, in your bash profile (or /etc/profile for system-wide defaults) and export it..........For example, I like mcedit (command line text editor bundled with the Midnight Commander package, or mc), and have entered these entries in /etc/profile:
Code:

EDITOR="/usr/bin/mcedit-debian"
VISUAL="/usr/bin/mcedit-debian"
export EDITOR VISUAL

From the vipw man page:
Quote:

vipw and vigr will edit the files /etc/passwd and /etc/group, respectively. With the -s flag, they will edit the shadow versions of those files, /etc/shadow and /etc/gshadow, respectively. The programs will set the appropriate locks to prevent file corruption.

When looking for an editor, the programs will first try the environment variable VISUAL, then the environment variable EDITOR, and finally the default editor, vi.
:)

Frustin 04-04-2005 02:27 AM

usermod -d /home/directory

was the other method i was looking for. i didnt want to edit the file directory. Working on live boxes, changing files like that can lead to distruction and death.


All times are GMT -5. The time now is 02:50 PM.