LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 12-03-2004, 04:43 PM   #1
barton
Member
 
Registered: Nov 2004
Posts: 78

Rep: Reputation: 15
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

Last edited by barton; 12-03-2004 at 04:53 PM.
 
Old 12-03-2004, 04:58 PM   #2
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
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.
 
Old 12-03-2004, 05:22 PM   #3
zuralin
Member
 
Registered: Sep 2003
Distribution: Debian testing/unstable
Posts: 225

Rep: Reputation: 30
/etc/passwd
 
Old 12-03-2004, 05:37 PM   #4
barton
Member
 
Registered: Nov 2004
Posts: 78

Original Poster
Rep: Reputation: 15
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
 
Old 12-04-2004, 01:58 PM   #5
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
What has changing the password to do with moving a home dir?
 
Old 12-04-2004, 11:48 PM   #6
kboone
LQ Newbie
 
Registered: Dec 2004
Posts: 4

Rep: Reputation: 0
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
 
Old 12-05-2004, 06:04 AM   #7
Moloko
Member
 
Registered: Mar 2004
Location: Netherlands
Distribution: Debian
Posts: 729

Rep: Reputation: 30
thx, another enlightenment
 
Old 03-31-2005, 04:59 AM   #8
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
is there a command line method without running the risk of ruining the /etc/passwd file?
 
Old 04-01-2005, 05:21 PM   #9
Deeze
Member
 
Registered: Dec 2004
Distribution: Debian - Sarge -- Slackware 10.1 - Dropline
Posts: 154

Rep: Reputation: 30
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.
 
Old 04-01-2005, 05:47 PM   #10
thegeekster
Member
 
Registered: Dec 2003
Location: USA (Pacific coast)
Distribution: Vector 5.8-SOHO, FreeBSD 6.2
Posts: 513

Rep: Reputation: 33
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.
 
Old 04-04-2005, 02:27 AM   #11
Frustin
Member
 
Registered: May 2002
Location: Essex, UK
Distribution: Debian, Redhat, AIX 5L
Posts: 512

Rep: Reputation: 30
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.
 
  


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
Not able to go to other user's home directory biswajit_dey Linux - Software 6 07-21-2005 08:14 AM
Reading other user's home directory with Samba zupidupi Linux - Networking 7 04-14-2005 01:53 AM
changing user's default ftp home location GraemeK Linux - Networking 0 12-31-2003 12:11 PM
finding user's home directory within a daemon kurienmathew Programming 1 12-19-2003 03:22 AM
how to change a user's Home directory n1wil Linux - General 8 08-24-2002 03:22 PM


All times are GMT -5. The time now is 04:39 AM.

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