Score:0

About ssh configuration file internal "~" symbol parsing problem

hr flag

SEE: https://stackoverflow.com/questions/76844392/about-ssh-configuration-file-internal-symbol-parsing-problem

  1. I use the root account to log in to the system (HOME: /root)
  2. I executed a script file (source script)
  3. In script file, I changed the value of the environment variable HOME (HOME: /another)
  4. I use ~($HOME) in my SSH profile (~/.ssh/config)
  5. SSH -T [email protected] shows that ssh is still using the original default values (HOME: /root)

May I ask why? (The HOME I expect SSH to work with should be: /another) How can I solve this problem?

~/.ssh/config

Host gh github.com
    User git
    IdentitiesOnly yes
    HostName github.com
    IdentityFile ~/.ssh/id_rsa

I can be sure that the source script is working properly because the configuration file is found correctly through ~/.ssh/config(/another/.ssh/config);; Only ~(%d) in the configuration file is not effective, or the previous value(/root);

muru avatar
us flag
SSH doesn't use the `HOME` environment variable. It asks the system (usually eventually reading `/etc/passwd`, but could also be getting the details from LDAP, etc.) for the executing user's details.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.