ssh

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

how add public key to ssh-agent permanently

我们两清 提交于 2021-02-17 06:10:35
问题 I added my existed public key to ssh-agent but after restarting I need to run ssh-add ~/.ssh/id_rsa to add it again. Is there a way to add it permanently? 回答1: You can not do that. You would need some secure store for the passphrase and you don't have it in ssh-agent . By storing the passphrase in plaintext, you basically downgrade the security to none (and you would better do by removing the passphrase completely). There are applications in GNOME that store the passphrase securely encrypted

Set environment variable (PGPASSWORD) before executing a command (pg_dump) on Windows SSH server in Paramiko

妖精的绣舞 提交于 2021-02-16 15:14:28
问题 I want to create a backup of my postgres database via SSH connecting to a Windows Server 2019. I use the Paramiko Python library in order to do this, but unfortunately the sql-file does not contain any data (file size is 0 and files cannot not deleted as they are still opened in cmd). Thus, I suspect the execution of my command hasn't finished ... This is my function: def ssh_server(server, username, password, pg_pass, ps_user, database): client = paramiko.SSHClient() client.load_system_host

Spawning a child process with tty in node.js

删除回忆录丶 提交于 2021-02-16 04:45:25
问题 I am trying to do some work on a remote server using ssh--and ssh is called on the local machine from node.js A stripped down version of the script looks like this: var execSync = require("child_process").execSync; var command = 'ssh -qt user@remote.machine -- "sudo mv ./this.thing /to/here/;"'; execSync(command,callback); function callback(error,stdout,stderr) { if (error) { console.log(stderr); throw new Error(error,error.stack); } console.log(stdout); } I get the requiretty error sudo:

Spawning a child process with tty in node.js

一笑奈何 提交于 2021-02-16 04:44:07
问题 I am trying to do some work on a remote server using ssh--and ssh is called on the local machine from node.js A stripped down version of the script looks like this: var execSync = require("child_process").execSync; var command = 'ssh -qt user@remote.machine -- "sudo mv ./this.thing /to/here/;"'; execSync(command,callback); function callback(error,stdout,stderr) { if (error) { console.log(stderr); throw new Error(error,error.stack); } console.log(stdout); } I get the requiretty error sudo:

Create a complete Linux virtual machine infrastructure in Azure with Terraform

放肆的年华 提交于 2021-02-11 16:54:14
问题 So I'm very new creating virtual machines and Microsoft Azure. I'm trying to create one in terraform and link to my Azure account. I have been following this documentation: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-create-complete-vm. For some background; my goal is to create the VM, log in via ssh on a vpn and log the logins Using the sample code they provide however, I get this error: azurerm_virtual_machine.myterraformvm: compute.VirtualMachinesClient

Create a complete Linux virtual machine infrastructure in Azure with Terraform

青春壹個敷衍的年華 提交于 2021-02-11 16:52:20
问题 So I'm very new creating virtual machines and Microsoft Azure. I'm trying to create one in terraform and link to my Azure account. I have been following this documentation: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/terraform-create-complete-vm. For some background; my goal is to create the VM, log in via ssh on a vpn and log the logins Using the sample code they provide however, I get this error: azurerm_virtual_machine.myterraformvm: compute.VirtualMachinesClient

How can I run a shell script via SSH such that the environment of the remote computer is similar to that of the local computer?

早过忘川 提交于 2021-02-11 15:27:22
问题 I welcome rephrasing of my question, because I'm not sure exactly what the problem is called. I am trying to run a shell script via SSH using a command of the following form: ssh -o StrictHostKeyChecking=no lxplus0035 "cd ~/test; bash script1.sh" When I do this, the complex script script1.sh breaks with many syntax errors, operand errors and other errors. An example is as follows: stty: standard input: Invalid argument The script works fine when run directly, not via SSH, in the local system

How can I run a shell script via SSH such that the environment of the remote computer is similar to that of the local computer?

妖精的绣舞 提交于 2021-02-11 15:26:24
问题 I welcome rephrasing of my question, because I'm not sure exactly what the problem is called. I am trying to run a shell script via SSH using a command of the following form: ssh -o StrictHostKeyChecking=no lxplus0035 "cd ~/test; bash script1.sh" When I do this, the complex script script1.sh breaks with many syntax errors, operand errors and other errors. An example is as follows: stty: standard input: Invalid argument The script works fine when run directly, not via SSH, in the local system

How to set the Host header in JAX-RS / Apache CXF

自古美人都是妖i 提交于 2021-02-11 14:46:25
问题 I am trying to access a service over HTTPS but due to restrictive network settings I am trying to make the request through an ssh tunnel. I create the tunnel with a command like: ssh -L 9443:my-service.com:443 sdt-jump-server The service is only available via HTTPS, its hosted with a self-signed certificate, and it is behind a load-balancer that uses either the hostname or an explicit Host header to route incoming requests to the appropriate backend service. I am able to invoke the endpoint