-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How do I change the route cmder has to find ssh keys? #2930
Comments
By asking Claude 3 (AI) this are the steps.
set HOME=%CMDER_ROOT%.ssh I added a .ssh folder to the cmder root with the keys. |
Yeah I would not do it that way. Cmder has init scripts you can add that stuff to in your case it would be Add:
or whatever else you need to configure in your env. You could also look at |
Yeah the AI made up a bad answer, LOL. |
It does not recognise export as a command. Yeah, I did not test it well and in fact, it does not work |
If you edited |
apparently i am using |
For You can also do the same for
|
I tried that, and it does not give me an error message, but it wont add the keys. I checked |
I never said what you were trying to do would actually work. I have never even considered moving my I was just trying to tell you how to properly set env variables for various shells supported by Cmder. You may have to make a copy of the script you mentioned and edit it to do what you need. |
Ok, I need this to work in orther to have a portable working git with ssh keys so I don't have to copy my keys everywhere. |
Wouldn't using the ssh agent be useful here? Other than that, maybe editing the Doing a quick search it seems that |
I was able to make it work, thank you @DRSDavidSoft. i edited the line in init.bat that defines HOME and that did the trick as you pointed out. From: if not defined HOME set "HOME=%USERPROFILE%" To: if not defined HOME set "HOME=%CMDER_ROOT%\config" |
Caution The HOME environment variable is used by more than just ssh. Setting HOME to point into the Cmder config directory will break some other things. For example, it will make So, setting HOME is probably not the best way to resolve the problem. |
@chrisant996 Exactly, to my knowledge Windows doesn't provide a way to set the environment variables for a specific task. Best alternative is to alias ssh to a batch script that would temporarily set Personally I always make sure that Msys2 apparently takes care of Windows/Unix path as well. |
well, then there is no easy solution to that? maybe i could set the HOME variable at the start of the ssh agent script and set it back how it was at the end? |
Symlink %cmder_root%\config\.ssh to %userprofile%\.ssh and put ssh config and keys in %cmder_root%\config\.ssh Just a thought. I have not tested it. |
sadly I don't have symlink (i am working with windows), i tried with |
Below shows symlinks on Windows:
See below creating the symlink in the Cmder Cmd.exe shell: Note: I do not know if this will work but the symlink can be created. |
You need to delete the folder before trying to create the symlink. |
essentially this would make the files present in both locations. editing/adding files to one location would edit/add in both locations. |
That's the thing, my objective is to have cmder in a external drive so i can use it wherever without having to copy my ssh keys in every computer. I did not spect for this to be so conversome haha. |
@DarioArDi The only thing I know of is using a https://stackoverflow.com/questions/84096/setting-the-default-ssh-key-location |
@DarioArDi You could also write some code in your |
That would make it work, but again, i don't want to leave copies of my keys everywhere. |
Question
Right now it searches in "~/.ssh "but i would like to put a relative path to not have to copy my keys in the home directory of every computer that I use instead of geting them from the external drive.
I have searched everywhere, I tried looking at user_profile.cmd, start-ssh-agent.cmd and init.bat.
Checklist
The text was updated successfully, but these errors were encountered: