-1

I am able execute a sh file using PuTTY. But when I try to execute the same in plink it's throwing a permission denied error.

I am able to execute basic command like la - let or PWD and more using plink.

But only sh files are throwing permission denied error.

In command prompt I typed this

plink -ssh -l username -pw password host -m input.txt>  output.txt

If I mention ls -lrt it's working fine. But running sh file is not working.

No antivirus.

Input text:

./start shellscriptname.sh

Output:

Username and path and

permission denied keyboard interactive

Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328
  • There is no sh file in your command line. Please show the code that's being executed and the error you're getting. – Ansgar Wiechers Jul 20 '17 at 21:38
  • I mention in the input.txt file. Because I have to move to one and I need to execute the sh file – user244611 Jul 21 '17 at 04:51
  • Yes, that was already clear to me. Please *show* the content of `input.txt` and the error message. – Ansgar Wiechers Jul 21 '17 at 07:06
  • .start shellname.sh this command in input text and error in output text is permission denied – user244611 Jul 21 '17 at 07:23
  • I cant add full details of output – user244611 Jul 21 '17 at 07:23
  • Please [edit] your question and copy/paste content and error message. Don't paraphrase. If there are sensitive information in the output you may obfuscate that, but leave the rest intact. – Ansgar Wiechers Jul 21 '17 at 07:24
  • The content is permission denied with path and username nothing more – user244611 Jul 21 '17 at 07:43
  • I edited the question with input and output text – user244611 Jul 21 '17 at 07:46
  • *permission denied keyboard-interactive* means that the SSH server doesn't accept password authentication. Try public key authentication instead. If literal commands work, but your script doesn't, it means what you're executing tries to establish *another* SSH connection and fails. What exactly is `./start`? Is it a shell script? What is its content? – Ansgar Wiechers Jul 23 '17 at 22:08

1 Answers1

0

You are missing a dash before pw.

It should be:

plink -ssh -l username -pw password host -m input.txt>  output.txt
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • If I mention ls - lrt in input text it's showing me the output thanks – user244611 Jul 21 '17 at 08:51
  • So show us exact contents of your `input.txt` and exact output. I do not think that *"Username and path and permission denied keyboard interactive"* is **exact** output. Or post a screenshot. – Martin Prikryl Jul 21 '17 at 10:01
  • permission denied keyboard interactive this what it's mentioned in the output.i already said what is in the input – user244611 Jul 21 '17 at 12:44