Home › Forums › FABRIC General Questions and Discussion › SSH Permission Denied
- This topic has 5 replies, 3 voices, and was last updated 3 years, 11 months ago by
Hussam Nasir.
-
AuthorPosts
-
November 30, 2021 at 4:25 pm #1164
I’m having trouble using the ssh command from the hello_fabric tutorial. My bastion key is uploaded and I’m able to use paramiko but if I try to use the automatically generated ssh command I get this error:
ssh -i /home/fabric/.ssh/id_rsa_fabric -i /home/fabric/.ssh/id_rsa -J susanna_moser_0051524387@bastion-1.fabric-testbed.net centos@63.239.135.94
susanna_moser_0051524387@bastion-1.fabric-testbed.net: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
kex_exchange_identification: Connection closed by remote hostAny advice? I’m confused on why it would work with paramiko but not ssh.
November 30, 2021 at 4:30 pm #1166Try
evalssh-agent -sfollowed byssh-add /path/to/<fabric key file>. Then take your ssh command above, remove the first key option/value and run it again.-
This reply was modified 3 years, 11 months ago by
ADAM GRIFFITH.
November 30, 2021 at 4:35 pm #1168That worked, thank you!
November 30, 2021 at 4:49 pm #1169Extended answer: For my personal sanity I added a pattern resembling to
~/.ssh/configfile:### The External Fabric Bastion host Host fabric-bastion-host HostName bastion-1.fabric-testbed.net Port 22 User susanna_moser_0051524387 IdentityFile ~/work/id_rsa_fabric
This transforms ssh commands into
ssh -J fabric-bastion-host -i ~/.ssh/id_rsa centos@63.239.135.94without the need for the ssh-agent voodoo.December 1, 2021 at 7:03 pm #1170That’s smart, thank you!
December 7, 2021 at 12:13 pm #1187Here is my version of the ssh config file. Its advisable to save it in ~/work/.ssh/config rather than ~/.ssh/config since ~/work is persistent upon re-creation of the jupyterhub instance
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
ServerAliveInterval 120Host bastion-?.fabric-testbed.net
User <your bastion host username>
ForwardAgent yes
Hostname %h
IdentityFile <path to your bastion host private key>
IdentitiesOnly yesHost * !bastion-?.fabric-testbed.net
ProxyJump <your bastion host username>@bastion-1.fabric-testbed.net:22
##ProxyJump <your bastion host username>@bastion-2.fabric-testbed.net:22Once this file is saved, you no longer need the -J param as long as this file is included in your ssh command .
For example.
ssh -F ~/work/.ssh/config centos@63.239.135.94 should work
-
This reply was modified 3 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.