ssh

How to deal with “Pseudo-terminal will not be allocated because stdin is not a terminal.”

对着背影说爱祢 提交于 2020-12-02 07:45:23
问题 ssh -t remotehost vim /tmp/x.txt I know that I can run a command like the above. But I would like to be able to run any local bash code in a remote machine. For this reason, I'd like to call the remote 'bash -s' so that can process any local bash code. ssh -t remotehost 'bash -s' <<< vim /tmp/x.txt However, the above example shows "Pseudo-terminal will not be allocated because stdin is not a terminal." Is there any way to let ssh take local bash code via stdin and run it via the remote 'bash

how to check if a host is in your known_host ssh

雨燕双飞 提交于 2020-12-02 06:22:11
问题 I have the following command works in my script that adds the host to the known hosts in ssh. VAR2=$(expect -c ' spawn ssh -o StrictHostKeyChecking=no '"$REMOTE_HOST_USER@$REMOTE_HOST_IP"' expect "*?assword:*" send "'"$REMOTE_HOST_PASSWD"'\r" expect { "Permission denied, please try again." { exit '"$WRONG_PASSWORD"' } } ') Works fine, but I need to control before the command if the host is already in known_hosts and not execute command if it is already in known_hosts. How can i check if an

how to check if a host is in your known_host ssh

心已入冬 提交于 2020-12-02 06:20:42
问题 I have the following command works in my script that adds the host to the known hosts in ssh. VAR2=$(expect -c ' spawn ssh -o StrictHostKeyChecking=no '"$REMOTE_HOST_USER@$REMOTE_HOST_IP"' expect "*?assword:*" send "'"$REMOTE_HOST_PASSWD"'\r" expect { "Permission denied, please try again." { exit '"$WRONG_PASSWORD"' } } ') Works fine, but I need to control before the command if the host is already in known_hosts and not execute command if it is already in known_hosts. How can i check if an

how to check if a host is in your known_host ssh

家住魔仙堡 提交于 2020-12-02 06:18:18
问题 I have the following command works in my script that adds the host to the known hosts in ssh. VAR2=$(expect -c ' spawn ssh -o StrictHostKeyChecking=no '"$REMOTE_HOST_USER@$REMOTE_HOST_IP"' expect "*?assword:*" send "'"$REMOTE_HOST_PASSWD"'\r" expect { "Permission denied, please try again." { exit '"$WRONG_PASSWORD"' } } ') Works fine, but I need to control before the command if the host is already in known_hosts and not execute command if it is already in known_hosts. How can i check if an

“Renci.SshNet.Common.SshException: Invalid private key file” when loading SSH private key from configuration string using SSH.NET

百般思念 提交于 2020-12-01 09:35:20
问题 I'm trying to send a file to some server using SFTP. During this process I'm getting the exception Renci.SshNet.Common.SshException: Invalid private key file. at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase) Generated the keys using PuTTYgen, shown below is an sample format of private key file. It has both the public and the private keys. PuTTY-User-Key-File-2: ssh-rsa Encryption:none comment: rsa-key-20190327 Public-Lines: 4 AAAAB..... ...... Private-Lines: 8 AAAAgQ.

Vagrant hangs at "SSH auth method: Private key

你。 提交于 2020-12-01 09:22:39
问题 I am running VirtualBox 5.0.24 and Vagrant 1.8.5 on Digital Ocean VPS running on Ubuntu 14.04 LTS Precise I am using the box ubuntu/precise64 Everything works fine but when i do vagrant up it hangs at the SSH auth method: Private key and the exit out giving time out. Now, i can consider increasing the execution time but it already takes a fare amount of time before giving that error. I don't know what I am doing wrong. Here is my VAGRANTFILE # -*- mode: ruby -*- # vi: set ft=ruby : Vagrant

How to use VPN with Bitbucket Pipelines

霸气de小男生 提交于 2020-11-30 06:07:30
问题 I need to access a remote server from Bitbucket Pipelines. This remote server is available only to a specific host which has its IP address whitelisted. Here is what I want: Pipelines <---> The gateway host <---> The remote server I was trying to use sshutle to setup an ssh-based VPN to forward all network traffic via the gateway host, but it looks like Pipelines don't allow containers to run VPN (see issue #12753). What can I do to access the remote server? 回答1: There is a solution if

Fatal Error when updating submodule using GIT

二次信任 提交于 2020-11-30 02:22:11
问题 I am trying to update the submodules of this git repositary but I keep getting a fatal errors: [root@iptlock ProdigyView]# git submodule update --recursive Cloning into core... Permission denied (publickey). fatal: The remote end hung up unexpectedly Clone of 'git@github.com:ProdigyView/ProdigyView-Core.git' into submodule path 'core' failed Or this way [root@iptlock root]# git clone --recursive https://github.com/ProdigyView/ProdigyView.git Cloning into ProdigyView... remote: Counting

Fatal Error when updating submodule using GIT

谁说胖子不能爱 提交于 2020-11-30 02:21:10
问题 I am trying to update the submodules of this git repositary but I keep getting a fatal errors: [root@iptlock ProdigyView]# git submodule update --recursive Cloning into core... Permission denied (publickey). fatal: The remote end hung up unexpectedly Clone of 'git@github.com:ProdigyView/ProdigyView-Core.git' into submodule path 'core' failed Or this way [root@iptlock root]# git clone --recursive https://github.com/ProdigyView/ProdigyView.git Cloning into ProdigyView... remote: Counting

Command using ChannelExec not executed - Jsch

笑着哭i 提交于 2020-11-29 03:56:25
问题 I am using Jsch to create a file in the server and execute some commands. For the file creation, it's working fine, however, for the command execution, doesn't. It keeps the status -1 (still working on it) and keep there forever. This happen for shell execution or when I try to became root. Follow the method used below: public void upload(String localPath) throws IOException { Session session = connectToServer(); System.out.println("In upload"); ChannelSftp channelSftp =