Skip to content

Instantly share code, notes, and snippets.

@vimagick
Created June 15, 2026 00:21
Show Gist options
  • Select an option

  • Save vimagick/fce53bdf9bee0a851d4aa49d66d02095 to your computer and use it in GitHub Desktop.

Select an option

Save vimagick/fce53bdf9bee0a851d4aa49d66d02095 to your computer and use it in GitHub Desktop.
Openwrt UBUS Remote Access

Server

ssh root@192.168.1.1
vi /usr/share/rpcd/acl.d/anonymous.json
service rpcd restart && service uhttpd restart

Client

curl http://192.168.1.1/ubus --json @payload.json
curl http://192.168.1.1/ubus --json @restart.json
{
"unauthenticated": {
"description": "allow anonymous user to run program",
"write": {
"ubus": {
"file": ["exec"],
"rc": ["init"]
},
"file": {
"/path/to/your/program": ["exec"]
}
}
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "call",
"params": [
"00000000000000000000000000000000",
"file",
"exec",
{
"command": "/path/to/your/program",
"params": ["arg1", "arg2", "arg3"]
}
]
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "call",
"params": [
"00000000000000000000000000000000",
"rc",
"init",
{
"name": "shadowsocks",
"action": "restart"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment