-1

I try to connect from my local machine to a server with plink. From the server i need to connect to an other local mashine over ssh to perform some commands

my try is:

plink -load "puttyProfile" -pw password "ssh admin@address"

which works. But now i want to give the ssh an operation like this

plink -load "puttyProfile" -pw password "ssh admin@address "cd .."   "

my error looks very strange something like this

#< CLIXML <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" .... 

which goes on for a while. Please give some advise =D Greetings

Olgidos
  • 231
  • 1
  • 14

2 Answers2

0

Ok got it myself.. on the last pc where i want to do the operations ssh was using powershell and not command prompt. It seems like powershell cant work with the list of operations given over ssh. i changed to command promp and it works bettet. Also i need to change the inner " to ' chaining commands wasnt a problem ether when u use && the ; wont work

ssh admin@address "ssh admin2@address2 'cd ..  &&  dir'  ; echo hey "
Olgidos
  • 231
  • 1
  • 14
0
"C:\\Program Files\\PuTTY\\plink.exe" -ssh "10.164.107.11" -l "karan" -pw "3Wdgwqd@Ws" -m "command.txt"

in commands you can write:

cd / ;
cd /local/apps/coreservices-s3/;
echo -e "The file is present in\n ";

find . -type f -name "TextFile4*";

echo -e "The content of the file is :\n ";
find . -name "vccvdv6.txt" |xargs cat

echo -e "\n\n."
Paul Roub
  • 36,322
  • 27
  • 84
  • 93