LinuxQuestions.org
Register a domain and help support LQ
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 07-17-2013, 05:07 AM   #1
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Rep: Reputation: 13
Change Default Home Directory Location


Hi,

Apologies if I'm not using the right terminology here, I'm guessing that's why I'm not getting the solution I want when I search for this question.

I'm using a pi with an attached hard drive. What I'd like to do is when I SSH in, rather than find myself in /home/pi, find myself in /media/hdd, as there's where I find everything I use and rarely use /home/pi.

I do not want to move /home/pi at all, I still need it for all my config files.

Thanks
 
Old 07-17-2013, 05:47 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 7,793

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
I would compromise by running the following line (in /home/pi)

Code:
ln -s /media/hdd  .
then /home/pi is the home directory, with config files. /home/pi/hdd is /media/hdd, and you don't have to fiddle with anything.

If you really want /media/hdd as the home dir, you would hit problems if ever the pi came up and /media/hdd wasn't there. You can do that sore of thing to yourself with usermod (man usermod) but what I'm suggesting is safer. This way, if the disk isn't there, it's a "no such file or directory" error.
 
1 members found this post helpful.
Old 07-17-2013, 05:53 AM   #3
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
You can execute custom script after login, to change your working directory, for example inside "~/.profile" or "~/.bashrc". Just add
Code:
cd /media/hdd
at end.

Last edited by eSelix; 07-17-2013 at 05:57 AM.
 
1 members found this post helpful.
Old 07-17-2013, 05:55 AM   #4
NotAComputerGuy
Member
 
Registered: Jun 2012
Distribution: Linux Mint - Debian Edition
Posts: 349

Original Poster
Rep: Reputation: 13
Thank you for highlighting potential problems and presenting a safe, simple and elegant solution, whilst also presenting the solution to my original question if I felt like taking a risk!
 
Old 07-17-2013, 07:22 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 7,793

Rep: Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752Reputation: 752
Sounds like you're happy - great :-). That was quick. Mark it solved and carry omn.
 
  


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
[SOLVED] Change Default Home Directory for Ldap User sunveer Linux - Newbie 1 08-15-2012 12:27 AM
[SOLVED] How can i change my HOME (/home/user) directory location to something else? QueenZ Linux - Newbie 6 08-05-2010 07:26 AM
Change Default Home Directory with LDAP and Automount greslore Linux - General 3 06-23-2009 04:32 PM
how to change location of /home? mark_2811 Linux - General 4 01-23-2004 07:19 AM
changing user's default ftp home location GraemeK Linux - Networking 0 12-31-2003 01:11 PM


All times are GMT -5. The time now is 05:43 PM.

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