Bitcoin Forum
November 05, 2024, 02:15:01 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Allow API commands without ssh access  (Read 201 times)
dexterov (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 14, 2019, 04:58:26 PM
Last edit: May 15, 2019, 12:15:38 AM by frodocooper
 #1

Hello!

I have Antminer S9 with latest firmware from 04.03.2019 (Hardware Version   30.2.1.3). There is no access by ssh, opened just 3 ports (80, 4028, 6060) on the Antminer's side. I can ask miner with simple command like this:

Code:
echo {"command":"version"} | nc 192.168.X.X 4028

with answer

Code:
{"STATUS":
[{"STATUS":"S",
"When":1557826683,
"Code":22,
"Msg":"BMMiner versions",
"Description":"bmminer 1.0.0"}],
"VERSION":
[{"BMMiner":"2.0.0",
"API":"3.1",
"Miner":"30.2.1.3",
"CompileTime":"Mon Mar 4 11:37:08 CST 2019",
"Type":"Antminer S9"}],
"id":1}

But when i try to send command like

Code:
echo {"command":"privileged"} | nc 192.168.X.X 4028

i have access error:

Code:
{"STATUS":
[{"STATUS":"E",
"When":1557846787,
"Code":45,
"Msg":"Access denied to 'privileged' command",
"Description":"bmminer 1.0.0"}],
"id":1}

And i dont understand how i can update my access level without ssh?

Another question is how is possible to use API and send commands/manage parameters of Antminer in C++ code remotely from local net? May be some libraries for that?
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3165


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
May 14, 2019, 07:22:13 PM
 #2

Your miner is in API restricted mode by default that is why you are getting this error message "Msg":"Access denied to 'privileged' command",

In order to change the restricted mode to Privileged API access, you must access the SSH root but the big problem about your miner you are using the latest version of s9 firmware(2019) If you are using this firmware your miner doesn't have SSH access because it's disabled, unlike lower version.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
dexterov (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 15, 2019, 07:28:11 AM
 #3

Your miner is in API restricted mode by default that is why you are getting this error message "Msg":"Access denied to 'privileged' command",

In order to change the restricted mode to Privileged API access, you must access the SSH root but the big problem about your miner you are using the latest version of s9 firmware(2019) If you are using this firmware your miner doesn't have SSH access because it's disabled, unlike lower version.

So there are no ways of creating software of managing Antminer's hardware with latest version of firmware? Only after downgrade?
BitMaxz
Legendary
*
Offline Offline

Activity: 3430
Merit: 3165


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
May 15, 2019, 08:53:11 AM
Last edit: May 15, 2019, 11:46:55 PM by frodocooper
 #4

You can try to use awesomeminer they are adding some feature for s9 miner to remotely reboot through web without SSH access.

Or you can flash the miner with t9+ firmware through program recovery(SD card Flashing) you can find the procedure from here Click me

Then after you successfully flash it with t9+ flash it again with s9 firmware(Make to use lower version, not the 2019 firmware) through WebGUI.

So that you can have access to SSH.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
dexterov (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 15, 2019, 01:43:55 PM
 #5

Thanx! It works, i did the downgrade of OS till 2017 version, now with ssh access.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!