LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-28-2006, 10:30 AM   #1
bhuwan
LQ Newbie
 
Registered: Jan 2006
Posts: 11

Rep: Reputation: 0
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?
 
Old 01-28-2006, 10:42 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
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'
 
Old 01-28-2006, 11:47 PM   #3
bhuwan
LQ Newbie
 
Registered: Jan 2006
Posts: 11

Original Poster
Rep: Reputation: 0
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?)
 
Old 01-29-2006, 01:20 AM   #4
twysm
Member
 
Registered: Jun 2004
Location: Lima - Perú
Distribution: Gentoo 2007.0
Posts: 78

Rep: Reputation: 15
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.
 
Old 01-29-2006, 07:15 AM   #5
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

Rep: Reputation: 30
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
 
Old 01-30-2006, 07:47 AM   #6
bhuwan
LQ Newbie
 
Registered: Jan 2006
Posts: 11

Original Poster
Rep: Reputation: 0
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
 
Old 01-30-2006, 08:39 AM   #7
Dtsazza
Member
 
Registered: Oct 2005
Location: Oxford, UK
Distribution: Debian Etch (w/ dual-boot XP for gaming)
Posts: 282

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

Last edited by Dtsazza; 01-30-2006 at 08:41 AM.
 
Old 01-30-2006, 09:19 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
~/ 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.
 
  


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
Apache Root/Home Directory and setting up FTP for home directories? Mankind75 Linux - Newbie 6 07-23-2006 02:37 PM
Home Directory! UltraSoul Solaris / OpenSolaris 1 01-01-2005 09:26 AM
home directory paul62 Linux - Newbie 3 11-18-2004 08:39 PM
mountig - change ro to rw, delete directory, change rw to ro ?? itsjustme Linux - General 6 10-17-2003 11:48 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 12:36 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration