0

I'm trying to submit a form with the following content of textarea:

scp -P 22 ~/.ssh/id_rsa.pub remote:.ssh/authorized_keys

But it doesn't accept, the following error appears on submitting:

You don't have permission to access /test.php on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

When I try any normal text, it's accepted!

This is my code:

<form action="" method="post">
<textarea name='test' rows="10" cols="100">scp -P 22 ~/.ssh/id_rsa.pub remote:.ssh/authorized_keys
</textarea>
 <input type="submit" />
</form>

Note: I'm running on PHP Version 7.2.7 on a reseller account

Behiry
  • 575
  • 5
  • 20
  • 1
    without any additional information about the receiving end, we can only make guesses – Gordon Jul 04 '18 at 06:01
  • It doesn't go to the receiving end at all! It just prevent form submission to the next page. – Behiry Jul 04 '18 at 06:14
  • Sure, maybe, but that does not change the fact that we can not help if you do not provide additional information. You need to add the relevant sections of the code to your question. – arkascha Jul 04 '18 at 06:20
  • And probably you need to invest time yourself to start debugging: where exactly is the process broken? What happens? Why? And how can you fix it, since generall this is _not_ an issue, it has to be something in your setup which you did not tell us anything about. – arkascha Jul 04 '18 at 06:21
  • Check your error logs there will likely be something in there to point you/us in the right direction here. – CodingInTheUK Jul 04 '18 at 06:21
  • Maybe your server tries to access `/knowledgebase.php` instead of `path/to/www/server/knowledgebase.php` – Justinas Jul 04 '18 at 06:28
  • There’s probably some extra filtering/ firewalling going on, either on the PHP level (suhosin or similar), or the web server level. – CBroe Jul 04 '18 at 06:35
  • Is this a local or live server ? .If its a live server , definitely the request is being blocked by some rules on your server.. the content that you are submitting is matching with the rules. We used to setup mod_security with some filtering. The request will be blocked if suspicious contents are encountered. – Shan Jul 04 '18 at 06:57
  • It's a live server, the same code works correctly on local server. But there is no mod_security on the live server. What else may be blocking the content? – Behiry Jul 05 '18 at 04:31

0 Answers0