ssh-keys

Create a SSH private key with ssh-keygen that is accepted by JSch [duplicate]

孤人 提交于 2021-02-18 12:47:08
问题 This question already has answers here : “Invalid privatekey” when using JSch (6 answers) Closed 1 year ago . Not directly a programming question, but somehow related. JSch (Java SSH library) does not seem to allow private keys that macOS 10.14 creates using $ ssh-keygen -t rsa -b 4096 What command I should use to create a private key file with such a format: -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,.... which is accepted by JSch? 回答1: You seem to need a

Ansible SSH private key in source control?

旧时模样 提交于 2021-02-17 07:44:36
问题 I have been developing an Ansible playbook for a couple of weeks, therefore, my experience with such technology is relatively short. Part of my strategy includes using a custom ansible_ssh_user for provisioning hosts throughout the inventory, however, such user will need its own SSH key pair, which would involve some sort of a plan for holding/storing its correspondent private key. On a production environment, this playbook would be cloned/pulled and run inside a certain playbook node whose

SSH config to access multiple repo not working

故事扮演 提交于 2021-02-09 08:44:07
问题 Here's the config file: Host bitbucket.org HostName bitbucket.org User git IdentityFile ~/.ssh/id_rsa Host bitbucket-office.org HostName bitbucket-off.org User git IdentityFile ~/.ssh/work_rsa Host bitbucket-personal.org HostName bitbucket-per.org User git IdentityFile ~/.ssh/personal_rsa I don't know what's wrong with set up. I want to connect to 2 remote repos from the same local machine. Setting up a config file was the solution I found over the internet. But somehow, I am just able to use

Recovering lost AWS EC2 Key Pairs

℡╲_俬逩灬. 提交于 2021-02-08 12:07:01
问题 AWS rookie here. I created a few EC2 instances under my AWS account and reused the same Key Pair for all of them. I believe (IIRC) that I had generated the Key Pair from inside AWS, but that could be wrong. Over this past weekend I sold my old laptop (after completely wiping the hard disk) and got a new one. I'm just remembering now ( :facepalm ) that I forgot to copy all my SSH private keys to a flash drive and that I no longer have them. All I want/need to do is to SSH into my EC2 instances

Recovering lost AWS EC2 Key Pairs

和自甴很熟 提交于 2021-02-08 12:03:10
问题 AWS rookie here. I created a few EC2 instances under my AWS account and reused the same Key Pair for all of them. I believe (IIRC) that I had generated the Key Pair from inside AWS, but that could be wrong. Over this past weekend I sold my old laptop (after completely wiping the hard disk) and got a new one. I'm just remembering now ( :facepalm ) that I forgot to copy all my SSH private keys to a flash drive and that I no longer have them. All I want/need to do is to SSH into my EC2 instances

Loading key from an SSH jumphost using Paramiko

梦想的初衷 提交于 2021-02-08 07:22:11
问题 I am connecting from host1 to host3 using a middle host2. host1 --> host2 --> host3 Here is my code that is working fine: # SSH to host2 ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host2, username=host2_username) # SSH to host3 vmtransport = ssh.get_transport() dest_addr = (host3, 22) local_addr = (host2, 22) vmchannel = vmtransport.open_channel("direct-tcpip", dest_addr=dest_addr, src_addr=local_addr) ssh3 =

Loading key from an SSH jumphost using Paramiko

感情迁移 提交于 2021-02-08 07:20:44
问题 I am connecting from host1 to host3 using a middle host2. host1 --> host2 --> host3 Here is my code that is working fine: # SSH to host2 ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(host2, username=host2_username) # SSH to host3 vmtransport = ssh.get_transport() dest_addr = (host3, 22) local_addr = (host2, 22) vmchannel = vmtransport.open_channel("direct-tcpip", dest_addr=dest_addr, src_addr=local_addr) ssh3 =

Purpose of pubkey parameter of JSch.addIdentity

痞子三分冷 提交于 2021-02-08 06:33:15
问题 I'm referring to public void addIdentity(String name, byte[] prvkey, byte[] pubkey, byte[] passphrase) throws JSchException I tried using it and no matter what input I give as pubkey (doesn't matter the length or the characters), as long as the prvkey matches, the connection will be established. Is this the normal behavior? Why is the pubkey even requested then? After a bit more research, it seems like the pubkey is not ignored on purpose, but it has to respect certain rules to be taken into

SSH agent forwarding during docker build

爱⌒轻易说出口 提交于 2021-02-06 09:51:35
问题 While building up a docker image through dockerfile, I have to clone a github repo. I have added my public ssh keys to my git hub account and i am able to clone the repo from my docker host. While i see that i can use docker host's ssh key by mapping $SSH_AUTH_SOCK env variable at the time of docker run like docker run --rm -it --name container_name \ -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) \ -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK my_image . How can i do same during docker build ? 回答1

SSH Agent forwarding inside docker compose container

99封情书 提交于 2021-02-06 09:12:27
问题 Could not open a connection to your authentication agent. I am following the approach of mounting the $SSH_AUTH_SOCK as a volume, but doing so with compose. Setup ~/.ssh/config Host * ForwardAgent yes Dockerfile: FROM atlashealth/ruby:2.2.2 RUN apt-get update -qq && \ apt-get install -qy build-essential libxml2-dev libxslt1-dev \ g++ qt5-default libqt5webkit5-dev xvfb dbus \ libmysqlclient-dev \ mysql-client openssh-client git && \ # cleanup apt-get clean && \ cd /var/lib/apt/lists && rm -fr