LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Change HOME directory? (https://www.linuxquestions.org/questions/linux-newbie-8/change-home-directory-408949/)

bhuwan 01-28-2006 10:30 AM

Change HOME directory?
 
Since I don't have access to ~/, I can't create a direcctory called ".ssh" (so I keep getting this error: Could not create directory '"<REM>/.ssh'.).

IS there any way I can fool "ssh" and change the directory (home path presumably) to something that I have access to write too?

Oliv' 01-28-2006 10:42 AM

Hi,

To change user_foo home directory, use usermod command:
Code:

usermod -d /new/path user_foo
To also move the content of user_foo into the new home directory:
Code:

usermod -d /new/path -m user_foo
Oliv'

bhuwan 01-28-2006 11:47 PM

Quote:

Originally Posted by Oliv'
Hi,

To change user_foo home directory, use usermod command:
Code:

usermod -d /new/path user_foo
To also move the content of user_foo into the new home directory:
Code:

usermod -d /new/path -m user_foo
Oliv'

Will this work w/o root access? I am a plain old user (any way to change dir temp?)

twysm 01-29-2006 01:20 AM

Quote:

Originally Posted by bhuwan
Will this work w/o root access? I am a plain old user (any way to change dir temp?)

This is done with root access only.

Dtsazza 01-29-2006 07:15 AM

As a bit of an aside, I thought that "~" was automagically expanded to your home directory (wheresoever it lived) as opposed to just "/home/<username>". In any event, it sounds like you actually don't have write permissions in your home directory... The home directory is specified in the /etc/passwd file, and if you haven't changed things yet, I'd be very interested to see the output of
Code:

ls -ld ~
and how it compares to
Code:

cat /etc/passwd | grep <yourusername> | cut -d : -f 6

bhuwan 01-30-2006 07:47 AM

Quote:

Originally Posted by Dtsazza
As a bit of an aside, I thought that "~" was automagically expanded to your home directory (wheresoever it lived) as opposed to just "/home/<username>". In any event, it sounds like you actually don't have write permissions in your home directory... The home directory is specified in the /etc/passwd file, and if you haven't changed things yet, I'd be very interested to see the output of
Code:

ls -ld ~
and how it compares to
Code:

cat /etc/passwd | grep <yourusername> | cut -d : -f 6

They match..btw PLESK screws everything up:Pengy:

Dtsazza 01-30-2006 08:39 AM

It wasn't just the names I was interested in, but the permissions on "~" (whatever it expands to). If you have write access, you should be able to create the directory '.ssh'. If you don't have write access, then I wouldn't advise any workarounds - there'll be a lot of software out there (probably Linux itself) that assumes you have write access to your home directory, so it's worth fixing...

Edit: And there'll be ways around PLESK screwing things up, too. If it really likes to play around with environment variables and the like, it should probably have its own user. I run an Oracle database off this box, which has its own user for the same reason.

timmeke 01-30-2006 09:19 AM

~/ indeed expands to your home directory.
~some_user/ expands to some_user's home directory, where you can replace "some_user" by any valid username on your system.


All times are GMT -5. The time now is 05:51 AM.