LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-24-2002, 02:40 AM   #1
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Rep: Reputation: 0
how to change a user's Home directory


Hi here is what I need to do:

I need to change the HOME directory for a user. Here is the env info:

[netwiz@linux netwiz]$ env
PWD=/home/netwiz
HOSTNAME=linux.wizworks.net
QTDIR=/usr/lib/qt3-gcc2.96
LESSOPEN=|/usr/bin/lesspipe.sh %s
USER=netwiz
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01 ;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz =01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3 5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL=/var/spool/mail/netwiz
INPUTRC=/etc/inputrc
LANG=en_US.iso885915
SSH_CLIENT=192.168.80.106 32861 22
DISPLAY=localhost:10.0
LOGNAME=netwiz
SHLVL=1
SHELL=/bin/bash
HISTSIZE=1000

HOME=/home/netwiz <------ I want to change this to "/home"

TERM=xterm
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/netwiz/bin
SSH_TTY=/dev/pts/0
_=/usr/bin/env


Any help would be GREATLY appreciated!

~ John
 
Old 08-24-2002, 02:58 AM   #2
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
Edit /etc/passwd, change the home dirdctory to whatever it is you want.

Make sure the new home directory is owned by the user.

Regards
 
Old 08-24-2002, 12:08 PM   #3
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Original Poster
Rep: Reputation: 0
Bas Prompt

Ok thanks for replying, but now there's something different. My Bash Prompt has changed. How do I make it say:

netwiz@linux home$ ?

this is what is looks like now, I'll also post the env data:

bash-2.05a$ env
PWD=/home
HOSTNAME=linux.wizworks.net
QTDIR=/usr/lib/qt3-gcc2.96
LESSOPEN=|/usr/bin/lesspipe.sh %s
USER=netwiz
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36i=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi= 01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01 ;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz =01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;3 5:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL=/var/spool/mail/netwiz
INPUTRC=/etc/inputrc
LANG=en_US.iso885915
SSH_CLIENT=192.168.80.106 32780 22
DISPLAY=localhost:10.0
LOGNAME=netwiz
SHLVL=1
SHELL=/bin/bash
HISTSIZE=1000
HOME=/home
TERM=xterm
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
PATH=/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin
SSH_TTY=/dev/pts/0
_=/usr/bin/env
bash-2.05a$ <--- this is what it changed to, which doesn't show the current dir.
 
Old 08-24-2002, 12:23 PM   #4
MartBrooks
Member
 
Registered: May 2002
Location: London
Distribution: Debian
Posts: 388

Rep: Reputation: 31
man bash

and take a look at the PS1 and PS2 variables.

Regards
 
Old 08-24-2002, 01:12 PM   #5
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Original Poster
Rep: Reputation: 0
Ok I looked inthe man page, but it is not clear how to make use of the PS1 or PS2 variables. Where are they set? How do you set them, do you have to be logged in as the current user or as root?

Thanks for the speedy replies.

~ John
 
Old 08-24-2002, 01:24 PM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
can i just suggest that you DON'T change it.. it's very very poor practise to deliberatly break conventions. i can guess that it's becuase you only have one user etc... but you really shouldn't

typically though PS1 would be set in somewhere like /etc/bashrc can't guess why it's changed for you though... maybe you've not copied your .bashrc file from your original home directory? that's the file that will call the global bashrc
 
Old 08-24-2002, 01:44 PM   #7
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Original Poster
Rep: Reputation: 0
Chris,

I tried copying the .bashrc file to the new home directory, no effect. I have multiple users on the system. I only want to change the prompt for one user.

I checked the .bashrc file against the file of another user and they are identical.

This system is a RED HAT 7.3 set up as a server.
 
Old 08-24-2002, 03:01 PM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well stricly speaking you should have an /etc/skel directory, the contents of which should comprise the essesntial files for a user directory. still a very very bad thing to do though
 
Old 08-24-2002, 03:22 PM   #9
n1wil
LQ Newbie
 
Registered: May 2002
Posts: 20

Original Poster
Rep: Reputation: 0
ok then. I'll leave well enough alone. But thanks for your help and willingness to respond.

~ John
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission problems when removing user's home directory. davethegenius Linux - Software 3 08-11-2005 04:01 PM
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 home directory? HOW barton Debian 10 04-04-2005 02:27 AM
finding user's home directory within a daemon kurienmathew Programming 1 12-19-2003 03:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:21 AM.

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