Mobaxterm Ssh Private Key

1 view
Skip to first unread message

Argelia Long

unread,
Aug 4, 2024, 2:22:53 PM8/4/24
to mafectimyf
Oncethe key is generated, keep that in a different folder in your windows drives and refer it by complete path in the "-i" option. The windows drives are referred as '/drives/c/', 'drives/d/' etc in MobaXterm. If the private key is kept at E:\keys\id_rsa then the command will look like,

If you're using MobaXterm regularly, the best way to deal with this is to use a permanent location for the home directory rather than the default Temp directory. You can do this by going to Settings->Configuration->Miscellaneous Options -> Use the following persisten HOME directory. In this case the keys can stay in the home directory and you need not supply an "i" option


So, when you start up MobaXTerm, can you try some stuff, like running "pwd" and seeing what directory it thinks it's in and work on putting the key into there? In your ssh command, you should be able to specify the full path to the key with something like "ssh -i /path/to/ssh/key/id_rsa" plus the other ssh options you're using.


Alternatively, you may be able to specify some alternative path. If MobaXTerm is Cygwin based, you may be able to say something like "/cygdrive/c/Documents/ssh/id_rsa", which should correspond to "C:\Documents\ssh\id_rsa" on your filesystem.


What private key does MobaXterm use by default, and can I change it? I read through the documentation, found nothing on what the default key that is used. I know there is the C:\Users\\.ssh directory, with a public and private key pair. But its not clear what is used. Unlike ssh in Linux I cant just run ssh -vvvvv to see more output. I also tried enabling DEBUG3 in sshd to see if I could see which public key was passed but, it only shows signatures not the actual public key.


I'm attempting to link my Windows 11 PC to my Github account using ssh (as per this guide). I'm using cygwin in MobaXterm, and have successfully completed the process previously on a Windows 7 machine. The problem this time arises when trying to add the private-key using ssh-add; it produces the errorCould not add identity "/home/mobaxterm/.ssh/id_ed25519": agent refused operation. I definitely have the agent running.


Previous questions have identified overly lax file permissions as a cause for this error. I have set the persistent home directory to a folder on my C drive, and in that directory given .ssh permissions 700 and the id_ed25519 file permissions 600 (and checked that they have been applied). However, ls -la /home/mobaxterm/.ssh reveals id_ed25519 has permissions 644. I don't understand how the permissions can be different, as I assumed /home/mobaxterm is just a symbolic link: if I delete or add files in my directory, the changes are reflected in /home/mobaxterm. Running chmod directly on /home/mobaxterm has no effect.


For both of the options you'll need to add your private keys in PPK format to PageAnt (installed with Putty) and specify you Use external Pageant in MobaXterm SSH settings:Refer to step 1 of this guide to learn how to add keys to PageAnt.


when I open mobaxterm --> create a new ssh connection --> enter the hostname (jump host in my case) and username --> and when I try to connect to this session, it works fine and then I need to manually ssh to customer servers after I get connected to jump host.


when I open mobaxterm --> create a new ssh connection --> enter the customer hostname --> under Network setting --> I enable "Connect through SSH gateway (jump host) and enter jump server hostname and username --> save the session.When I try to connect to this session, it gives error as "Remote side unexpectedly closed network connection".


I had this problem too. In the configuration for "Basic SSH settings" for 'Remote Host' I initially had username@remote_host.com and did not specify a username in the 'Specify username' field.To fix this issue I changed the configuration so that the 'Remote host' field had only the remote_host.com server name with no @ sign, and I checked 'Specify username' and gave my username there. Now the jump host worked well!


Go to the MobaXterm website and download the free version. Make sure toselect the Portable edition from the download page. Create a foldercalled MobaXterm in a known location in your computer and decompress thecontents of the downloaded zip file inside it.


Click on the Save public key button and save it to some desiredlocation; we recommend to name it id_rsa_vsc.pub. You must upload this public key to youryour VSC accountpage before you can login to a VSC cluster.


Finally click on the Save private key button and save that file also;we recommend to name this file id_rsa_vsc.ppk. As the private part ofthe name suggests, this file should not be shared, you must keep it in a safelocation in your computer.You will have to remember where you saved it, as you will need it toconnect to the cluster after you receive the confirmation that your accountis active.


3. Using your University email, send your public key file ONLY, (do not send us your private key) to it-resear...@mst.edu and allow some time for an administrator to copy your public key for remote access. You will receive email confirmation when you are authorized.


4. Under Actions, click Generate. When prompted use your pointing device (mouse, trackpad, trackball, etc.) to move your cursor around the blank area under Key (this generates randomness the utility uses to create your key pair).


6. Give your file a name (such as putty_key) and select a location to store it on your computer before hitting Save. Make sure this is a location you can easily find again, your user's home folder is a good place.


8. Make Save as type set to PuTTY Private Key Files (*.ppk), give the file a name (such as putty_private_key), and select a location to store it on your computer before hitting Save. Make sure this is a location you can easily find again, your user's home folder is a good place. It is advisable to set a passphrase to protect this file since all your encryption will be done with this file.


9. Using your University email, send your public key file ONLY, (do not send us your private key) to it-resear...@mst.edu and allow some time for an administrator to copy your public key for remote access. You will receive email confirmation when you are authorized.


SSH (Secure Shell) keys are a set of two pieces of information that you use to identify yourself and encrypt communication to and from a server. Usually this takes the form of two files: a public key (often saved as id_rsa.pub) and a private key (id_rsa or id_rsa.ppk). To use an analogy, your public key is like a lock and your private key is what unlocks it. It is ok for others to see the lock (public key), but anyone who knows the private key can open your lock (and impersonate you).


When you connect to a remote server in order to sign in, it will present your lock. You prove your identity by unlocking it with your secret key. As you continue communicating with the remote server, the data sent to you is also locked with your public key such that only you can unlock it with your private key.


Choose a secure passphrase. Your passphrase will prevent access to your account in the event your private key is stolen. You will not see any characters appear on the screen as you type. The response will be:


You can also use one of the Windows Subsystem for Linux (WSL) distributions and follow the Linux instructions above. However, you will probably run into issues if you try to use any graphical applications.


Just a tip I hope may help someone else with the headaches I had. F21 is right that you need to copy the key out of the PuTTYGen window instead of saving the file, but after copying, the way you paste may have significant impact on whether your key will work or not. Some editors will alter the text as you paste, or do something with newlines or something that makes the authorized_keys file invalid.


What I have found to be the least likely to break is to echo the full string and redirect the output to the file. Right-clicking in PuTTY to paste the key string to the commandline, it works out like this (with the example given above):


In my case the reason was that private key file (.ppk) had been removed in Putty authentication agent i.e. Pageant. I just updated it again to Pageant there and connection worked perfectly after that.




Launch MobaXterm and select MobaKeyGen (SSH key generator) from "Tools" menu. If you already have PuTTY session settings (in registry?), they will be automatically loaded on left pane of the window. This PuTTY setting may be usable.




In case of EdDSA, ECDSA or RSA type, you may find optional item at the position specified by "2". Please choose/input value there.

Please don't choose Ed448. This is not available on RCCS login server.




The public key shown as a string in this field is what we need. Extract all the contents in this filed into notepad or others, and then save it! (Do not miss ssh-/ecdsa- part in the beginning!) Note: you don't need public key from "Save public key" button; we need only OpenSSH format one.

3a8082e126
Reply all
Reply to author
Forward
0 new messages