• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 262
  • Last Modified:

How do I change $HOME when I ssh to different servers

When I ssh to server1, $HOME=/home/user
When I ssh to server2, $HOME=/Network/Servers/home/user

How do I change the $HOME varaible so it points to the directory I want when I ssh to the server?
0
pogosru
Asked:
pogosru
  • 2
1 Solution
 
ravenplCommented:
export HOME="/new/home/value"
Also You may set it in Your startup file .profile (or .bash_profile) in Your true home directory.
but note, that HOME is set automatically to Your proper home directory, changeing it may trick some applications, and therefore prevent them from working properly.
0
 
pogosruAuthor Commented:
I was kind of hoping there was a way to do it, so that when I ssh'd it would automatically be the correct HOME without the export. How is HOME automatically set to the proper HOME directory? I have only one true HOME directory. But with ssh it changes with different servers
0
 
ravenplCommented:
Well, You can have different HOMEs on different servers - right?
Your home is saved in /etc/passwd file, and the var HOME is set to whatever /etc/passwd says upon login (no matter if ssh or local terminal).
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now