ssh

Paramiko SSH python

假如想象 提交于 2021-01-29 16:53:02
问题 I´m trying the simplest way to make a SSH connection and execute a command with paramiko import paramiko, base64 client = paramiko.SSHClient() client.load_system_host_keys() client.connect('10.50.0.150', username='XXXXX', password='XXXXXX') stdin, stdout, stderr = client.exec_command('show performance -type host-io') for line in stdout: print '... ' + line.strip('\n') client.close() ------------ERROR----------------------- Traceback (most recent call last): File "a.py", line 5, in <module>

Modify an xml server on several servers

♀尐吖头ヾ 提交于 2021-01-29 15:41:02
问题 I asked Previously how to replace statement in xml file <app-connector port="${APP_CONNECTOR_PORT}" address="192.168.0.254" By <app-connector port="${APP_CONNECTOR_PORT}" address="0.0.0.0" Someone Helped me by giving a sed command which works in single host. sed -i '/<app-connector port="${APP_CONNECTOR_PORT}" address="192.168.0.254"$/s/192.168.0.254/0.0.0.0/' file So Now the question is to apply this to serveral hosts in text file: 192.168.0.1 192.168.0.2 192.168.0.3 192.168.0.4 192.168.0.5

Lost access to EC2 instance

99封情书 提交于 2021-01-29 15:31:07
问题 I reformatted my macbook and completely forgot to copy my ~/.ssh directory. I tried ssh'ing into my EC2 instance $ ssh ec2-user@xx.xxx.xxx.xx -i xxx.pem -v OpenSSH_8.1p1, LibreSSL 2.7.3 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 47: Applying options for * debug1: Connecting to xx.xxx.xxx.xx [xx.xxx.xxx.xx] port 22. debug1: connect to address xx.xxx.xxx.xx port 22: Operation timed out ssh: connect to host xx.xxx.xxx.xx port 22: Operation timed out

Access and append local file from remote host in bash script

非 Y 不嫁゛ 提交于 2021-01-29 08:12:06
问题 From my bash script, doing ssh login to the remote host. Sending my config file along with a script to the remote host to access the variables. Code is as below: #!/bin/bash source ~/shell/config.sh script=$(cat <<\____HERE pubkeyarray=() privkeyarray=() for (( w=1; w<=3; w++)) do cleos create key --file key[$w].txt privatekey=$(sed -ne 's/^Private key: \([^ ]*\).*/\1/p' ~/key[$w].txt) pubkey=$(sed -ne 's/^Public key: \([^ ]*\).*/\1/p' ~/key[$w].txt) pubkeyarray+=("$pubkey") privkeyarray+=("

Can I connect to GHTorrent MySQL/Mongodb database through ssh?

久未见 提交于 2021-01-29 05:51:46
问题 I am trying to connect to GHTorrent database through ssh in python so I can deal with the data. There is the example of how this ssh works in command lines and it works. http://ghtorrent.org/mysql.html import pymysql from sshtunnel import SSHTunnelForwarder mypkey = paramiko.RSAKey.from_private_key_file("/Users/***/.ssh/id_rsa") with SSHTunnelForwarder( ('web.ghtorrent.org', 3306), ssh_username="ghtorrent", ssh_pkey=mypkey, ssh_private_key_password="*****",#my password for my pc remote_bind

Can I connect to GHTorrent MySQL/Mongodb database through ssh?

此生再无相见时 提交于 2021-01-29 05:50:35
问题 I am trying to connect to GHTorrent database through ssh in python so I can deal with the data. There is the example of how this ssh works in command lines and it works. http://ghtorrent.org/mysql.html import pymysql from sshtunnel import SSHTunnelForwarder mypkey = paramiko.RSAKey.from_private_key_file("/Users/***/.ssh/id_rsa") with SSHTunnelForwarder( ('web.ghtorrent.org', 3306), ssh_username="ghtorrent", ssh_pkey=mypkey, ssh_private_key_password="*****",#my password for my pc remote_bind

How can I use Windows' built-in OpenSSH ssh-agent in VS Code, instead of Git bash's?

六月ゝ 毕业季﹏ 提交于 2021-01-29 02:08:15
问题 I am running OpenSSH on Windows, using the built-in OpenSSH included since the Autumn/Fall Creators Update. I am using ssh just fine in my PowerShell, but Visual Studio Remote Development (and I guess Git for Windows?) are not using my OpenSSH. Instead, they seem to be using the Git for Windows SSH client from MinGW. This means all my ssh-add ed keys are not present in the VS or Git ssh-agent . How can I get Visual Studio (and maybe Git?) to use the builtin OpenSSH install so that I can use

PEPPER (Softbank Robotics): How can I send “external” data (e.g., sensor) to Coregraphe Software?

戏子无情 提交于 2021-01-28 21:44:52
问题 I'm trying to import "external" data (e.g., a string, a sensor value, etc.) to Coregraphe environment. In a more large context, I need, for example, to send - in a certain way - a letter "A". The Coregraphe-based system must recognize it and actuate a preset operation. Up to now, I tried to write a log message via PuTTY, by logging in Pepper robot and using: qicli log-send -m A I can see it (i.e., the message) in the log INFO of the Coregraphe environment: [INFO ] qicli.qilog.logsend /home

Make git-submodule update from specific Host in config

蓝咒 提交于 2021-01-28 19:48:46
问题 Using this guide here I have created a work ssh-key ( id_rsa_work ) and changed my config file to # Personal GitHub account Host github.com HostName github.com User git AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa # Work GitHub account Host github.com-work HostName github.com User git AddKeysToAgent yes IdentityFile ~/.ssh/id_rsa_work I have added the work ssh to my work git-repo and I can call git clone git@github.com-work:user/test.git and clone it. The problem is that there is a submodule

Jenkins publish over SSH failed to change to remote directory

女生的网名这么多〃 提交于 2021-01-28 19:32:19
问题 I am using the Jenkins publish over SSH plugin to transfer files to a remote server. When I configure the Publish over SSH plugin and specify a Remote Directory, testing the configuration always fails with this error: jenkins.plugins.publish_over.BapPublisherException: Failed to change to remote directory [C:\zzTest] However if I leave the Remote Directory filed blank I get a success message when I test the configuration. Any ideas as to what I am doing wrong here? The directory definitely