ssh

Is it possible to run multiple command with remote command option in putty?

安稳与你 提交于 2020-06-13 09:18:33
问题 I want to run multiple commands automatically like sudo bash, ssh server01, ls , cd /tmp etc at server login.. I am using Remote command option under SSH in putty. I tried multiple commands with delimiter && but not working. 回答1: There is a some information lacking in your question. You say you want to run sudo bash , then ssh server01 . Will sudo prompt for a password in your remote server? Assuming there is no password in sudo, running bash will open another shell waiting for user input.

Run and execute multiple dependent SSH commands using C#

筅森魡賤 提交于 2020-06-13 07:02:18
问题 I want to change directory inside SSH using C# with SSH.NET library: SshClient cSSH = new SshClient("192.168.80.21", 22, "appmi", "Appmi"); cSSH.Connect(); Console.WriteLine("current directory:"); Console.WriteLine(cSSH.CreateCommand("pwd").Execute()); Console.WriteLine("change directory"); Console.WriteLine(cSSH.CreateCommand("cdr abc-log").Execute()); Console.WriteLine("show directory"); Console.WriteLine(cSSH.CreateCommand("pwd").Execute()); cSSH.Disconnect(); cSSH.Dispose(); Console

Run and execute multiple dependent SSH commands using C#

空扰寡人 提交于 2020-06-13 07:01:27
问题 I want to change directory inside SSH using C# with SSH.NET library: SshClient cSSH = new SshClient("192.168.80.21", 22, "appmi", "Appmi"); cSSH.Connect(); Console.WriteLine("current directory:"); Console.WriteLine(cSSH.CreateCommand("pwd").Execute()); Console.WriteLine("change directory"); Console.WriteLine(cSSH.CreateCommand("cdr abc-log").Execute()); Console.WriteLine("show directory"); Console.WriteLine(cSSH.CreateCommand("pwd").Execute()); cSSH.Disconnect(); cSSH.Dispose(); Console

Can't connect VS Code to Linux machine for remote development

此生再无相见时 提交于 2020-06-11 01:11:25
问题 I am getting this error on VS Code and have no clue why it fails [15:14:59.543] Log Level: 2 [15:14:59.555] remote-ssh@0.51.0 [15:14:59.555] win32 x64 [15:14:59.560] SSH Resolver called for "ssh-remote+xx.xx.xx.xx", attempt 1 [15:14:59.561] SSH Resolver called for host: xx.xx.xx.xx [15:14:59.561] Setting up SSH remote "xx.xx.xx.xx" [15:14:59.621] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server [15:14:59.624] Install and start server if needed [15:15

Can't connect VS Code to Linux machine for remote development

这一生的挚爱 提交于 2020-06-11 01:09:30
问题 I am getting this error on VS Code and have no clue why it fails [15:14:59.543] Log Level: 2 [15:14:59.555] remote-ssh@0.51.0 [15:14:59.555] win32 x64 [15:14:59.560] SSH Resolver called for "ssh-remote+xx.xx.xx.xx", attempt 1 [15:14:59.561] SSH Resolver called for host: xx.xx.xx.xx [15:14:59.561] Setting up SSH remote "xx.xx.xx.xx" [15:14:59.621] Using commit id "0ba0ca52957102ca3527cf479571617f0de6ed50" and quality "stable" for server [15:14:59.624] Install and start server if needed [15:15

Given HTTPs URL of git repository, is it possible to retrieve the SSH url?

左心房为你撑大大i 提交于 2020-06-08 13:11:05
问题 In a Git Repo, if i have the information of the HTTPs protocol saved, is it possible to retrieve the SSH url of it without having to manually login and copy ? 回答1: In the general case, no, this is not possible. Git does not require that a repository be accessible by multiple methods and does not provide a way to automatically discover all URLs for a repository, even if a repository is accessible by multiple methods. The user must intrinsically know this, and can map from one to the other by

Using “KexAlgorithms diffie-hellman-group1-sha1” did not resolve “no matching key exchange method found” error

百般思念 提交于 2020-06-08 05:05:40
问题 There's a lot of questions about the following error, but they all have same solution which did not have any effect: $ git push Unable to negotiate with 192.168.XXX.XXX: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. There is an article on openssh.com that didn't help. Particularly this was suggested: ... in the ~/.ssh/config file: Host

How do I pass arbitrary arguments to a command executed over SSH? [duplicate]

为君一笑 提交于 2020-06-01 03:37:54
问题 This question already has answers here : Command line Parameters in bash shell script in nested ssh (2 answers) Variable issues in SSH (1 answer) Passing a variable to a remote host in a bash script with ssh and EOF [duplicate] (2 answers) How to have simple and double quotes in a scripted ssh command (1 answer) Closed 2 years ago . Assume I have a script with the following contents located at ~/echo.sh on a remote server example.com : #!/usr/bin/env bash echo "Arg 1: $1" echo "Arg 2: $2"

How do I pass arbitrary arguments to a command executed over SSH? [duplicate]

╄→尐↘猪︶ㄣ 提交于 2020-06-01 03:37:38
问题 This question already has answers here : Command line Parameters in bash shell script in nested ssh (2 answers) Variable issues in SSH (1 answer) Passing a variable to a remote host in a bash script with ssh and EOF [duplicate] (2 answers) How to have simple and double quotes in a scripted ssh command (1 answer) Closed 2 years ago . Assume I have a script with the following contents located at ~/echo.sh on a remote server example.com : #!/usr/bin/env bash echo "Arg 1: $1" echo "Arg 2: $2"

Host key verification failed - amazon EC2

六眼飞鱼酱① 提交于 2020-05-28 14:44:22
问题 I am working with win 7 and git bash as well as an amazon EC2 instance. I tried to log into my instance: $ ssh -i f:mykey.pem ubuntu@ec2-52-10-**-**.us-west-2.compute.amazonaws.com @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also