plink

Plink strips out double quote marks

99封情书 提交于 2019-12-11 12:59:30
问题 I'm using PowerShell to remotely issue a command on a Linux server. I'm using plink to connect to the server. However plink strips out double quotes in the commands I want to run. This stops those commands from working. $user = "user" $password = "password" $hostname = "host" $plinkPath = gci -Recurse | Where-Object {$_.Name -eq "plink.exe"} | select -First 1 | foreach{$_.FullName} & $plinkPath "$User@$hostname" -pw $password "echo" "hello ab`"cdef world" This gives the result hello abcdef

Wait between sending login and commands to serial port using Plink

百般思念 提交于 2019-12-10 11:43:29
问题 I want to make connection by serial port in PLINK . The problem is that the code (below) doesn't work because file remove.txt is all sent at once, while terminal is asking for a login and before it starting asking for commands. There is any possibilities to login first and then execute command file? The test is saved serial session (com5 baud 115200) Command: C:\PROGRA~1\PuTTY\plink -load test < C:\Users\qj2p70\Desktop\remove.txt remove.txt file: root root cd /cfg_usr/delphi/etc rm vip_coding

Plink cmd.exe mkdir with a space doesn't work

折月煮酒 提交于 2019-12-10 11:29:25
问题 I'm using plink on a windows 7 desktop to create a folder a on windows 2008 server. The server uses pragmaSSH to allow the SSH connection and everything works just fine there. The directory I want to create has a space in it and that is where my problem starts. I have a basic plink command that works like this plink.exe -i privatekey.ppk user@server cmd.exe /c mkdir "c:\asdfasdf" but changing that command to this fails. so the space is for sure my issue. plink.exe -i privatekey.ppk user

Plink returning unwanted characters via C#

孤者浪人 提交于 2019-12-10 10:42:39
问题 I am getting unwanted characters before and after my results when using Plink via C#: Command: ls -l */informatica/tgtdynamicparams*.out | grep vaulttest| grep 'Sep 1'|awk '{print $9}' | sort Linux result: aaco/informatica/tgtdynamicparams2269885_CHECK_REF_COMPANY.out cdph/informatica/tgtdynamicparams2225704_CDPHDRUGRECON.out cdph/informatica/tgtdynamicparams2225704_CDPHELIGRECON.out merh/informatica/tgtdynamicparams3454321_OPEN_TEST.out merh/informatica/tgtdynamicparams3454322_OPEN_TEST2.out

How can I use Powershell as my tramp-encoding-shell?

五迷三道 提交于 2019-12-08 15:58:46
问题 First I start up eshell then I enter the command cd /plink:<user>@<host>:/home/ then I get this error message Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. The command prompt has been disabled by your administrator. Press any key to continue . . . I am trying to connect with plink (which is in my path), also after going through the *Messages* buffer I found this. Couldn't find local shell prompt for (C:\Windows\system32\cmd.exe) I'm 90%

Cannot compile PuTTY, Plink or Pscp on Windows due to missing Windows/MSVC subdirectory

倾然丶 夕夏残阳落幕 提交于 2019-12-08 15:18:31
I need to download and compile plink/pscp on my Windows. Since I need specific version (0.69), I searched for the tag, and checked out to that commit. In putty readme, they write that if I want to compile on windows, there is Visual studio solution: Inside the windows/MSVC subdirectory are MS Visual Studio project files for doing GUI-based builds of the various PuTTY utilities. These have been tested on Visual Studio 7 and 10. You should be able to build each PuTTY utility by loading the corresponding .dsp file in Visual Studio. For example, MSVC/putty/putty.dsp builds PuTTY itself, MSVC/plink

How to pass user input automatically using plink.exe

守給你的承諾、 提交于 2019-12-08 11:06:41
问题 I need to login to an SSH session using password, and then execute the user input values for a particular account. For example: PLINK.EXE -ssh ***** -l ***** -pw ***** I am able to login, now what I need to do is enter below values: Please select account to logon: "U" Press RETURN to continue or OFF to cancel session - "RETURN" There are similarly this kind of user inputs needed. Is there a way I store the "*" values in a text file and load them using Plink. I tried: PLINK.EXE -ssh ***** -l *

PowerShell script to pass SecureString to Plink as account and sudo passwords

三世轮回 提交于 2019-12-08 08:28:41
问题 I'm trying to use Powershell (in order to be able to mask the password) to run Plink command on remote Linux machine to give top 20 directories under /opt... It connects, password is properly masked but no results Write-output shows the assembled command string is correct... but it just appears to hang and does not return results. could the it be that the write-output results is different than what plink actually sends? When I copy the write-output to cmd prompt and directly run it, it works

Using System.Diagnostics.Process to input a y to a Plink on standard input?

谁说我不能喝 提交于 2019-12-08 07:51:07
问题 How do I pass a Y into a process started by a System.Diagnostic.Process in PowerShell? function Start-NewPlinkProcess( [string]$pfile = 'plink.exe', [string]$arguments = 'somehost -l somelogin -pw somepasswd ping -c 12 someOtherHost > /home/homeie/mePingTestResults.txt' ){ $p = New-Object System.Diagnostics.Process; $p.StartInfo.UseShellExecute = $false; $p.StartInfo.RedirectStandardOutput = $true; $p.StartInfo.RedirectStandardInput = $true; $p.StartInfo.FileName = $pfile; $p.StartInfo

Password encryption using SecureString for plink.exe command

柔情痞子 提交于 2019-12-08 05:44:33
问题 I would like to encrypt a password in PowerShell I tried this : In CLI : Read-Host -prompt "Password ?" -AsSecureString | ConvertFrom-SecureString | out-file "D:\root.pwd" In my script.ps1 : $pwsNAS = Get-Content "D:\root.pwd" | ConvertTo-SecureString plink.exe root@192.168.x.y -pw $pwdNAS df But it doesn't work... I tried with credentials, but it doesn't seems to be better... (My password doesn't have any space or accented character) Any idea? 回答1: Of course it doesn't work. plink expects a